Particle FX (looped)
Notes from the author
EXAMPLE. MAKE FIRE BREATH FROM PED HEAD:
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
local new_ptfx_dictionary = "anm_fire_dancers"
local new_ptfx_name = "ent_anim_fire_breathe_loop"
local is_particle_effect_active = false
local current_ptfx_dictionary = new_ptfx_dictionary
local current_ptfx_name = new_ptfx_name
local current_ptfx_handle_id = false
local bone_index = 247 -- ["PH_Head"] = {bone_index = 247, bone_id = 57278},
local ptfx_offcet_x = 0.0
local ptfx_offcet_y = 0.0
local ptfx_offcet_z = 0.0
local ptfx_rot_x = -90.0
local ptfx_rot_y = 0.0
local ptfx_rot_z = 0.0
local ptfx_scale = 1.0
local ptfx_axis_x = 0
local ptfx_axis_y = 0
local ptfx_axis_z = 0
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if Citizen.InvokeNative(0x91AEF906BCA88877,0, 0x17BEC168) then -- just pressed E
if not is_particle_effect_active then
current_ptfx_dictionary = new_ptfx_dictionary
current_ptfx_name = new_ptfx_name
if not Citizen.InvokeNative(0x65BB72F29138F5D6, GetHashKey(current_ptfx_dictionary)) then -- HasNamedPtfxAssetLoaded
Citizen.InvokeNative(0xF2B2353BBC0D4E8F, GetHashKey(current_ptfx_dictionary)) -- RequestNamedPtfxAsset
local counter = 0
while not Citizen.InvokeNative(0x65BB72F29138F5D6, GetHashKey(current_ptfx_dictionary)) and counter <= 300 do -- while not HasNamedPtfxAssetLoaded
Citizen.Wait(0)
end
end
if Citizen.InvokeNative(0x65BB72F29138F5D6, GetHashKey(current_ptfx_dictionary)) then -- HasNamedPtfxAssetLoaded
Citizen.InvokeNative(0xA10DB07FC234DD12, current_ptfx_dictionary) -- UseParticleFxAsset
current_ptfx_handle_id = Citizen.InvokeNative(0x9C56621462FFE7A6,current_ptfx_name,PlayerPedId(),ptfx_offcet_x,ptfx_offcet_y,ptfx_offcet_z,ptfx_rot_x,ptfx_rot_y,ptfx_rot_z,bone_index,ptfx_scale,ptfx_axis_x,ptfx_axis_y,ptfx_axis_z) -- StartNetworkedParticleFxLoopedOnEntityBone
--current_ptfx_handle_id = Citizen.InvokeNative(0x8F90AB32E1944BDE,current_ptfx_name,PlayerPedId(),ptfx_offcet_x,ptfx_offcet_y,ptfx_offcet_z,ptfx_rot_x,ptfx_rot_y,ptfx_rot_z,ptfx_scale,ptfx_axis_x,ptfx_axis_y,ptfx_axis_z) -- StartNetworkedParticleFxLoopedOnEntity
is_particle_effect_active = true
else
print("cant load ptfx dictionary!")
end
else
if current_ptfx_handle_id then
if Citizen.InvokeNative(0x9DD5AFF561E88F2A, current_ptfx_handle_id) then -- DoesParticleFxLoopedExist
Citizen.InvokeNative(0x459598F579C98929, current_ptfx_handle_id, false) -- RemoveParticleFx
end
end
current_ptfx_handle_id = false
is_particle_effect_active = false
end
end
end
end)
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
ptfx_assets_looped = {
[ptfx_dictionary] = {ptfx_name},
}| # | dictionary | effect | Note |
|---|---|---|---|
| 801 | core | trail_splash_flour | |
| 802 | core | trail_splash_grain | |
| 803 | core | trail_splash_gunpowder | |
| 804 | core | trail_splash_oil | |
| 805 | core | trail_splash_petrol | |
| 806 | core | trail_splash_sand | |
| 807 | core | trail_splash_sugar | |
| 808 | core | trail_splash_water | |
| 809 | core | veg_disturb_flower_petals | |
| 810 | core | veg_disturb_flower_pollen | |
| 811 | core | veg_disturb_generic | |
| 812 | core | veh_air_debris | |
| 813 | core | veh_candle_flame | |
| 814 | core | veh_exhaust_boat | |
| 815 | core | veh_exhaust_boat_steam_large | |
| 816 | core | veh_exhaust_boat_steam_med | |
| 817 | core | veh_exhaust_boat_steam_med_turbine | |
| 818 | core | veh_exhaust_boat_steam_sma | |
| 819 | core | veh_exhaust_car | |
| 820 | core | veh_exhaust_car_steam | |
| 821 | core | veh_exhaust_hot_air_balloon | |
| 822 | core | veh_exhaust_misfire | |
| 823 | core | veh_exhaust_start | |
| 824 | core | veh_exhaust_train_smoke | |
| 825 | core | veh_exhaust_train_smoke_high | |
| 826 | core | veh_exhaust_train_smoke_low | |
| 827 | core | veh_exhaust_train_steam | |
| 828 | core | veh_ghost_train_furnace_fire | |
| 829 | core | veh_light_red_trail | |
| 830 | core | veh_trailer_petrol_spray | |
| 831 | core | veh_train_drain_cock_steam | |
| 832 | core | veh_train_furnace_fire | |
| 833 | core | veh_train_grd_disturb_dust_dirt | |
| 834 | core | veh_train_grd_disturb_dust_leaves | |
| 835 | core | veh_train_grd_disturb_dust_snow | |
| 836 | core | veh_train_piston_gland_steam | |
| 837 | core | veh_train_refrigerator_cold_air | |
| 838 | core | veh_train_room_cold_air | |
| 839 | core | veh_train_sparks | |
| 840 | core | veh_train_sparks_tender | |
| 841 | core | veh_train_whistle | |
| 842 | core | veh_vent_boat | |
| 843 | core | water_boat_bow | |
| 844 | core | water_boat_leak | |
| 845 | core | water_boat_lod | |
| 846 | core | water_boat_lod_bow | |
| 847 | core | water_boat_lod_side | |
| 848 | core | water_boat_oar_wade | |
| 849 | core | water_boat_prop | |
| 850 | core | water_boat_rev | |
| 851 | core | water_boat_steam_horseboat_bow | |
| 852 | core | water_boat_steam_horseboat_rev | |
| 853 | core | water_boat_steam_horseboat_wash | |
| 854 | core | water_boat_steam_keelboat_bow | |
| 855 | core | water_boat_steam_med_bow | |
| 856 | core | water_boat_steam_med_prop | |
| 857 | core | water_boat_steam_med_rev | |
| 858 | core | water_boat_steam_med_wash | |
| 859 | core | water_boat_steam_nbdguama_wash | |
| 860 | core | water_boat_steam_sma_bow | |
| 861 | core | water_boat_steam_sma_prop | |
| 862 | core | water_boat_steam_sma_rev | |
| 863 | core | water_boat_steam_sma_wash | |
| 864 | core | water_boat_steam_tugboat_bow | |
| 865 | core | water_boat_steam_tugboat_rev | |
| 866 | core | water_boat_steam_tugboat_wash | |
| 867 | core | water_boat_steam_turbine_bow | |
| 868 | core | water_boat_steam_turbine_rev | |
| 869 | core | water_boat_steam_turbine_wash | |
| 870 | core | water_boat_wash | |
| 871 | core | water_canoe_bow | |
| 872 | core | water_canoe_oar_wade | |
| 873 | core | water_canoe_rev | |
| 874 | core | water_canoe_wash | |
| 875 | core | water_pirogue_bow | |
| 876 | core | water_pirogue_rev | |
| 877 | core | water_pirogue_wash | |
| 878 | core | water_rowboat_bow | |
| 879 | core | water_rowboat_rev | |
| 880 | core | water_rowboat_swamp_bow | |
| 881 | core | water_rowboat_swamp_wash | |
| 882 | core | water_rowboat_wash | |
| 883 | core | water_splash_gator_wade | |
| 884 | core | water_splash_obj_trail | |
| 885 | core | water_splash_obj_wade | |
| 886 | core | water_splash_ped_duck_wade | |
| 887 | core | water_splash_ped_wade | |
| 888 | core | water_splash_ped_wade_human | |
| 889 | core | water_splash_ped_wade_lod | |
| 890 | core | water_splash_ped_wade_lower | |
| 891 | core | water_splash_ped_wade_lower_bear | |
| 892 | core | water_splash_ped_wade_lower_deer | |
| 893 | core | water_splash_ped_wade_lower_horse | |
| 894 | core | water_splash_rope_wade | |
| 895 | core | water_splash_veh_trail | |
| 896 | core | water_splash_veh_wade | |
| 897 | core | water_splash_wheel_cart | |
| 898 | core | weap_torch_fire_trail | |
| 899 | core | wheel_disp_blood | |
| 900 | core | wheel_disp_dirt_dry |