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 |
|---|---|---|---|
| 301 | core | ent_amb_campfire_sma | |
| 302 | core | ent_amb_campfire_sma_base | |
| 303 | core | ent_amb_campfire_sma_nosmoke | |
| 304 | core | ent_amb_campfire_sma_under | |
| 305 | core | ent_amb_campfire_smoke_distance | |
| 306 | core | ent_amb_campfire_smoke_distance_dark | |
| 307 | core | ent_amb_campfire_smoke_distance_gang | |
| 308 | core | ent_amb_campfire_smoke_distance_trail | |
| 309 | core | ent_amb_campfire_smolder | |
| 310 | core | ent_amb_candle_flame | |
| 311 | core | ent_amb_candle_flame_distance | |
| 312 | core | ent_amb_candle_flame_lit | |
| 313 | core | ent_amb_candle_flame_smoke | |
| 314 | core | ent_amb_cave_poison | |
| 315 | core | ent_amb_cave_poison_splash | |
| 316 | core | ent_amb_cig_smoke | |
| 317 | core | ent_amb_cig_smoke_linger | |
| 318 | core | ent_amb_cig_smoke_linger_casino | |
| 319 | core | ent_amb_cig_smoke_linger_lite | |
| 320 | core | ent_amb_cliff_snowfall | |
| 321 | core | ent_amb_cook_bubble | |
| 322 | core | ent_amb_corpse_bleeding | |
| 323 | core | ent_amb_door_snow_drifts | |
| 324 | core | ent_amb_drain_splash | |
| 325 | core | ent_amb_dust_motes | |
| 326 | core | ent_amb_dust_motes_window | |
| 327 | core | ent_amb_elec_crackle | |
| 328 | core | ent_amb_exhaust_thick | |
| 329 | core | ent_amb_exhaust_thin | |
| 330 | core | ent_amb_falling_embers | |
| 331 | core | ent_amb_falling_leaves_birch_l | |
| 332 | core | ent_amb_falling_leaves_birch_s | |
| 333 | core | ent_amb_falling_leaves_ficus_l | |
| 334 | core | ent_amb_falling_leaves_ficus_s | |
| 335 | core | ent_amb_falling_leaves_flower | |
| 336 | core | ent_amb_falling_leaves_maple_l | |
| 337 | core | ent_amb_falling_leaves_maple_s | |
| 338 | core | ent_amb_falling_leaves_moss | |
| 339 | core | ent_amb_falling_leaves_oak_l | |
| 340 | core | ent_amb_falling_leaves_oak_s | |
| 341 | core | ent_amb_falling_leaves_palm | |
| 342 | core | ent_amb_falling_leaves_pine | |
| 343 | core | ent_amb_falling_tree_leaves | |
| 344 | core | ent_amb_fire_lit | |
| 345 | core | ent_amb_fire_moon_still | |
| 346 | core | ent_amb_fire_oil_field | |
| 347 | core | ent_amb_fog_ring | |
| 348 | core | ent_amb_fountain_double | |
| 349 | core | ent_amb_fountain_mesh | |
| 350 | core | ent_amb_fountain_mesh_bottom | |
| 351 | core | ent_amb_fountain_nb_double | |
| 352 | core | ent_amb_fountain_new_gar | |
| 353 | core | ent_amb_fountain_spout | |
| 354 | core | ent_amb_furnace_fire_lrg | |
| 355 | core | ent_amb_furnace_heat_haze | |
| 356 | core | ent_amb_generic_fire_area | |
| 357 | core | ent_amb_generic_fire_area_spread | |
| 358 | core | ent_amb_generic_fire_crawling | |
| 359 | core | ent_amb_generic_fire_doorway | |
| 360 | core | ent_amb_generic_fire_field | |
| 361 | core | ent_amb_generic_fire_field_full | |
| 362 | core | ent_amb_generic_fire_field_full_sma | |
| 363 | core | ent_amb_generic_fire_field_nosmoke | |
| 364 | core | ent_amb_generic_fire_field_smoke | |
| 365 | core | ent_amb_generic_fire_fog | |
| 366 | core | ent_amb_generic_fire_int_fog | |
| 367 | core | ent_amb_generic_fire_line | |
| 368 | core | ent_amb_generic_fire_mesh | |
| 369 | core | ent_amb_generic_fire_mesh_no_smoke | |
| 370 | core | ent_amb_generic_fire_mesh_v1 | |
| 371 | core | ent_amb_generic_fire_plume | |
| 372 | core | ent_amb_generic_fire_rm_smoke | |
| 373 | core | ent_amb_generic_fire_roof | |
| 374 | core | ent_amb_generic_fire_roof_angle | |
| 375 | core | ent_amb_generic_fire_smoke_plume | |
| 376 | core | ent_amb_generic_fire_up | |
| 377 | core | ent_amb_generic_fire_win | |
| 378 | core | ent_amb_generic_fire_win_nosmoke | |
| 379 | core | ent_amb_generic_roof_smoke_fog | |
| 380 | core | ent_amb_generic_smolder_area | |
| 381 | core | ent_amb_generic_smolder_area_nopre | |
| 382 | core | ent_amb_generic_smolder_lrg | |
| 383 | core | ent_amb_ghost_train_steam | |
| 384 | core | ent_amb_gutter_drips | |
| 385 | core | ent_amb_gutter_splash | |
| 386 | core | ent_amb_hay_pile_debris | |
| 387 | core | ent_amb_haybale_debris | |
| 388 | core | ent_amb_haystack_debris | |
| 389 | core | ent_amb_hog_blood | |
| 390 | core | ent_amb_icicle_drip | |
| 391 | core | ent_amb_insect_bee_swarm | |
| 392 | core | ent_amb_insect_bees | |
| 393 | core | ent_amb_insect_butterfly_swarm2 | |
| 394 | core | ent_amb_insect_butterfly_swarm3 | |
| 395 | core | ent_amb_insect_butterfly_swarm4 | |
| 396 | core | ent_amb_insect_butterfly_swarm5 | |
| 397 | core | ent_amb_insect_butterflys_swarm | |
| 398 | core | ent_amb_insect_cockroaches | |
| 399 | core | ent_amb_insect_cockroaches_int | |
| 400 | core | ent_amb_insect_dragonfly_swarm |