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 |
|---|---|---|---|
| 901 | core | wheel_disp_dirt_wet | |
| 902 | core | wheel_disp_flour | |
| 903 | core | wheel_disp_generic_underwater | |
| 904 | core | wheel_disp_generic_wet | |
| 905 | core | wheel_disp_grass | |
| 906 | core | wheel_disp_grass_wet | |
| 907 | core | wheel_disp_gravel | |
| 908 | core | wheel_disp_gravel_wet | |
| 909 | core | wheel_disp_ice | |
| 910 | core | wheel_disp_leaves | |
| 911 | core | wheel_disp_leaves_wet | |
| 912 | core | wheel_disp_lod_dust_light | |
| 913 | core | wheel_disp_lod_dust_medium | |
| 914 | core | wheel_disp_lod_dust_sand_medium | |
| 915 | core | wheel_disp_mud_liquid | |
| 916 | core | wheel_disp_mud_soft | |
| 917 | core | wheel_disp_oil | |
| 918 | core | wheel_disp_petrol | |
| 919 | core | wheel_disp_sand | |
| 920 | core | wheel_disp_slush | |
| 921 | core | wheel_disp_snow | |
| 922 | core | wheel_disp_tar | |
| 923 | core | wheel_disp_water | |
| 924 | core | wheel_disp_water_puddle | |
| 925 | core | wheel_fric_concrete | |
| 926 | core | wheel_fric_dirt_dry | |
| 927 | core | wheel_fric_dirt_wet | |
| 928 | core | wheel_fric_flour | |
| 929 | core | wheel_fric_generic_underwater | |
| 930 | core | wheel_fric_generic_wet | |
| 931 | core | wheel_fric_grass_dry | |
| 932 | core | wheel_fric_gravel_dry | |
| 933 | core | wheel_fric_gravel_wet | |
| 934 | core | wheel_fric_ice | |
| 935 | core | wheel_fric_leaves_dry | |
| 936 | core | wheel_fric_mud_liquid | |
| 937 | core | wheel_fric_mud_soft | |
| 938 | core | wheel_fric_sand_dry | |
| 939 | core | wheel_fric_snow | |
| 940 | core | wheel_fric_tar | |
| 941 | core | wheel_spray_mud_liquid | |
| 942 | core | wheel_spray_mud_soft | |
| 943 | core | wheel_spray_snow | |
| 944 | core | wheel_spray_water | |
| 945 | core | wpn_scope_glint | |
| 946 | scr_shows_fire_dancer | scr_fire_dancer_disturb | |
| 947 | scr_fire_manager | ent_amb_campfire_dynamic | |
| 948 | scr_fire_manager | ent_amb_insect_water_flies | |
| 949 | scr_fire_manager | ent_anim_fire_tend_embers | |
| 950 | anm_blood | ent_anim_blood_drips | |
| 951 | anm_blood | ent_anim_blood_spurt | |
| 952 | anm_blood | ent_anim_blood_spurt_cougar | |
| 953 | anm_blood | ent_anim_mouth_blood | |
| 954 | anm_blood | ent_anim_stab_blood_drips | |
| 955 | anm_blood | ent_anim_throat_blood_deer | |
| 956 | anm_blood | ent_anim_throat_slit_bear | |
| 957 | anm_blood | ent_anim_wolf_blood_drip | |
| 958 | scr_train_robbery4 | scr_trainrob4_train_carriage_fire | |
| 959 | scr_train_robbery4 | scr_trn4_ground_plume | |
| 960 | scr_train_robbery4 | scr_trn4_train_const_smoke | |
| 961 | scr_train_robbery4 | scr_trn4_train_slide | |
| 962 | scr_train_robbery4 | scr_trn4_train_smoke_loop | |
| 963 | anm_core | ent_anim_boat_smoke | |
| 964 | anm_core | ent_anim_campfire_stomp | |
| 965 | anm_core | ent_anim_muz_smoking_barrel | |
| 966 | anm_core | ent_anim_ped_wade_snow | |
| 967 | anm_core | ent_anim_train_exhaust_smoke | |
| 968 | anm_core | ent_anim_vial_revive | |
| 969 | scr_net_moon_bartending | scr_net_moonshine_pour_bar | |
| 970 | scr_net_koth | scr_net_koth_smoke_factory | |
| 971 | anm_weapons | ent_anim_dynamite_fuse | |
| 972 | anm_weapons | ent_anim_gun_linger | |
| 973 | anm_weapons | ent_anim_molotov_flame | |
| 974 | anm_weapons | ent_anim_muz_gatling | |
| 975 | anm_weapons | ent_anim_muz_gatling_close | |
| 976 | anm_weapons | ent_anim_proj_key_trail | |
| 977 | scr_adv_sok | scr_adv_sok_torch | |
| 978 | scr_adv_sok | scr_adv_sok_torch_horseback | |
| 979 | scr_adv_sok | scr_adv_sok_torchsmoke | |
| 980 | scr_annesburg | blood_stone_crusher_stream | |
| 981 | scr_trelawny2 | scr_trl2_train_steam | |
| 982 | scr_mg_fishing | scr_mg_fishing_drips | |
| 983 | anm_brt | ent_anim_moonshine_pour | |
| 984 | cut_fud1 | CS_Fud1_Boat_scrape_sand_wet | |
| 985 | scr_arch_jameson3 | blood_stone_crusher_stream | |
| 986 | amb_lights | amb_arc_lamp_emit | |
| 987 | amb_lights | amb_bulb_g_01 | |
| 988 | amb_lights | amb_bulb_g_01_frosted | |
| 989 | amb_lights | amb_bulb_g_01_frosted_skin | |
| 990 | amb_lights | amb_bulb_g_01_lantern | |
| 991 | amb_lights | amb_bulb_g_01_sign | |
| 992 | amb_lights | amb_bulb_g_01_sign_frosted | |
| 993 | amb_lights | amb_bulb_g_01_skin | |
| 994 | amb_lights | amb_bulb_g_01_xmas_sign | |
| 995 | amb_lights | amb_bulb_g_01_xmas_sign_frosted | |
| 996 | amb_lights | amb_candle_flame_emit | |
| 997 | amb_lights | amb_gas_flame_emit | |
| 998 | amb_lights | amb_gas_flame_emit_narrow | |
| 999 | amb_lights | amb_lantern_flame_emit | |
| 1000 | amb_lights | amb_miner_hat_flame_emit |