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 |
|---|---|---|---|
| 1101 | scr_winter4 | proj_dynamite_trail | |
| 1102 | scr_winter4 | scr_winter4_horse_disturb_dust | |
| 1103 | scr_beat_murder_for_hire | scr_beat_mur_blood_spray | |
| 1104 | scr_smuggler2 | proj_cannon_trail | |
| 1105 | scr_beat_animal_mauling | scr_beat_anml_blood_spray | |
| 1106 | anm_smoking | cs_cig_smoke | |
| 1107 | anm_smoking | cs_cig_smoke_inhale | |
| 1108 | anm_smoking | ent_anim_cig_smoke | |
| 1109 | anm_smoking | ent_anim_cig_smoke_cigar | |
| 1110 | anm_smoking | ent_anim_cig_smoke_cigar_ember | |
| 1111 | anm_smoking | ent_anim_cig_smoke_ember | |
| 1112 | anm_smoking | ent_anim_cig_smoke_preload | |
| 1113 | anm_smoking | ent_anim_cig_smoke_trail | |
| 1114 | anm_smoking | ent_anim_cig_smoke_walking | |
| 1115 | anm_smoking | ent_anim_matchstick_flame | |
| 1116 | anm_smoking | ent_anim_rccig_linger_smoke | |
| 1117 | des_gry1_mnshine_exp | ent_ray_gry1_water_splash | |
| 1118 | markers_core | ent_amb_net_race_fire | |
| 1119 | markers_core | ent_amb_net_race_smoke | |
| 1120 | markers_core | ent_amb_net_race_smoke_target | |
| 1121 | markers_core | scr_net_race_arrow | |
| 1122 | scr_adv_ova_hunter | scr_hunter_cloak_haze_head | |
| 1123 | scr_adv_ova_hunter | scr_hunter_cloak_haze_limb | |
| 1124 | scr_adv_ova_hunter | scr_hunter_cloak_haze_torso | |
| 1125 | anm_chamberpot | ent_anim_chamberpot_toss | |
| 1126 | anm_chamberpot | ent_anim_chamberpot_toss_short | |
| 1127 | scr_rcm_native2 | scr_natv3_fire_oil_field | |
| 1128 | scr_rcm_native2 | scr_natv3_fire_oil_plume | |
| 1129 | scr_rcm_native2 | scr_natv3_generic_fire | |
| 1130 | scr_adv_ph | scr_adv_ph_glow_plinth | |
| 1131 | scr_adv_ph | scr_adv_ph_glow_bag | |
| 1132 | scr_adv_ph | scr_adv_ph_glow_bag_rear | |
| 1133 | scr_adv_ph | scr_adv_ph_glow_head | |
| 1134 | scr_adv_ph | scr_adv_ph_glow_limb | |
| 1135 | scr_adv_ph | scr_adv_ph_glow_plinth | |
| 1136 | scr_adv_ph | scr_adv_ph_glow_torso | |
| 1137 | scr_odr3 | scr_odr3_blood_spurt | |
| 1138 | scr_odr3 | scr_odr3_surgery_heat | |
| 1139 | scr_deadeye | scr_de_conviction_weapon_glow | |
| 1140 | scr_deadeye | scr_de_focus_tracer | |
| 1141 | scr_deadeye | scr_de_recuperate_wisps | |
| 1142 | scr_deadeye | scr_de_slippery_haze_head | |
| 1143 | scr_deadeye | scr_de_slippery_haze_limb | |
| 1144 | scr_deadeye | scr_de_slippery_haze_torso | |
| 1145 | scr_deadeye | scr_de_steady_smoke_torso | |
| 1146 | scr_deadeye | scr_de_watch_wisps | |
| 1147 | scr_demo1 | proj_dynamite_trail | |
| 1148 | scr_net_fme | scr_fme_corpse_fly_swarm | |
| 1149 | anm_gang2 | ent_anim_gng2_balloon_leaves | |
| 1150 | anm_gang2 | ent_anim_gng2_balloon_mud_scrape | |
| 1151 | anm_gang2 | ent_anim_gng2_balloon_wtr_spl | |
| 1152 | scr_beat_bear_trap | scr_beat_bear_blood_spray | |
| 1153 | scr_ind1 | scr_ind1_firework | |
| 1154 | scr_ind1 | scr_ind1_firework_lights | |
| 1155 | scr_net_dynamite | proj_dynamite_trail | |
| 1156 | scr_train_robbery3 | scr_trn3_water_splash_surface | |
| 1157 | scr_trelawny1 | scr_trelawny1_smoke | |
| 1158 | scr_net_race_checkpoints | scr_mp_item_pickup_highlight | |
| 1159 | scr_net_race_checkpoints | scr_net_race_slipstream | |
| 1160 | scr_vantage_point | scr_event_glint | |
| 1161 | scr_fussar1 | scr_fus1_lantern_fire | |
| 1162 | scr_fussar1 | scr_fussar1_cave_steam | |
| 1163 | scr_fussar1 | scr_fussar1_dust_cloud | |
| 1164 | scr_fussar1 | scr_fussar1_dust_fog | |
| 1165 | scr_fussar1 | scr_fussar1_dusty_interior | |
| 1166 | scr_fussar1 | scr_fussar1_sb_short | |
| 1167 | scr_fussar1 | trail_splash_oil | |
| 1168 | scr_braithwaites3 | scr_braithw3_curtain_fire_01 | |
| 1169 | scr_braithwaites3 | scr_braithw3_hall_smoke | |
| 1170 | scr_braithwaites3 | scr_braithw3_mansion_fire_crawling | |
| 1171 | scr_braithwaites3 | scr_braithw3_mansion_fire_under | |
| 1172 | scr_braithwaites3 | scr_braithw3_mansion_fire_win1 | |
| 1173 | scr_braithwaites3 | scr_braithw3_mansion_fire_win2 | |
| 1174 | scr_braithwaites3 | scr_braithw3_room_ash | |
| 1175 | scr_braithwaites3 | scr_braithw3_room_embers | |
| 1176 | scr_braithwaites3 | scr_braithw3_room_smoke_01 |