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 |
|---|---|---|---|
| 501 | core | ent_amb_steam_donkey_vent | |
| 502 | core | ent_amb_steam_geyser | |
| 503 | core | ent_amb_steam_pipe_hvy | |
| 504 | core | ent_amb_steam_pipe_lgt | |
| 505 | core | ent_amb_steam_piston | |
| 506 | core | ent_amb_steam_pot | |
| 507 | core | ent_amb_steam_vent_open_hvy | |
| 508 | core | ent_amb_steam_vent_open_lgt | |
| 509 | core | ent_amb_steam_vent_rnd_hvy | |
| 510 | core | ent_amb_steam_vent_round | |
| 511 | core | ent_amb_stove_fire_sml | |
| 512 | core | ent_amb_stove_pipe_smoke | |
| 513 | core | ent_amb_stove_pipe_smoke_darker | |
| 514 | core | ent_amb_swing_trap_dust | |
| 515 | core | ent_amb_tadpole_swarm | |
| 516 | core | ent_amb_tar_bubbles | |
| 517 | core | ent_amb_torch_fire | |
| 518 | core | ent_amb_toy_boat_idle_smoke | |
| 519 | core | ent_amb_trn4_train_smoke | |
| 520 | core | ent_amb_trolley_hook_sparks | |
| 521 | core | ent_amb_trop_fish_swarm_angel | |
| 522 | core | ent_amb_trop_fish_swarm_col | |
| 523 | core | ent_amb_trop_fish_swarm_lil | |
| 524 | core | ent_amb_washtub_lather | |
| 525 | core | ent_amb_water_cave_drips_mesh | |
| 526 | core | ent_amb_water_drips_cave_col | |
| 527 | core | ent_amb_water_drips_cave_lg | |
| 528 | core | ent_amb_water_drips_cave_med | |
| 529 | core | ent_amb_water_drips_cave_sm | |
| 530 | core | ent_amb_water_drips_hydro | |
| 531 | core | ent_amb_water_drips_lg | |
| 532 | core | ent_amb_water_drips_med | |
| 533 | core | ent_amb_water_drips_sm | |
| 534 | core | ent_amb_water_drips_sm_sound | |
| 535 | core | ent_amb_water_drips_trees | |
| 536 | core | ent_amb_water_icicle_drips_sm | |
| 537 | core | ent_amb_water_roof_drips_lg | |
| 538 | core | ent_amb_water_roof_drips_med | |
| 539 | core | ent_amb_water_roof_drips_sm | |
| 540 | core | ent_amb_water_roof_pour | |
| 541 | core | ent_amb_water_roof_pour_long | |
| 542 | core | ent_amb_water_roof_rain_mesh | |
| 543 | core | ent_amb_wf_bw | |
| 544 | core | ent_amb_wf_close_spray | |
| 545 | core | ent_amb_wf_cum_01 | |
| 546 | core | ent_amb_wf_dak_bb_01 | |
| 547 | core | ent_amb_wf_dak_bb_02 | |
| 548 | core | ent_amb_wf_dak_gp_03 | |
| 549 | core | ent_amb_wf_dak_gp_04 | |
| 550 | core | ent_amb_wf_dak_gp_05 | |
| 551 | core | ent_amb_wf_dak_gp_06 | |
| 552 | core | ent_amb_wf_dak_gp_v2_01 | |
| 553 | core | ent_amb_wf_dak_gp_v2_02 | |
| 554 | core | ent_amb_wf_dak_gp_v2_03 | |
| 555 | core | ent_amb_wf_dak_up_01 | |
| 556 | core | ent_amb_wf_dak_up_02 | |
| 557 | core | ent_amb_wf_dak_up_03 | |
| 558 | core | ent_amb_wf_decal | |
| 559 | core | ent_amb_wf_ely_01 | |
| 560 | core | ent_amb_wf_ely_splash | |
| 561 | core | ent_amb_wf_lens | |
| 562 | core | ent_amb_wf_lmr_mist | |
| 563 | core | ent_amb_wf_man | |
| 564 | core | ent_amb_wf_man_narrow | |
| 565 | core | ent_amb_wf_mist_lg | |
| 566 | core | ent_amb_wf_mist_md | |
| 567 | core | ent_amb_wf_proto_01 | |
| 568 | core | ent_amb_wf_proto_01_larger | |
| 569 | core | ent_amb_wf_proto_02_cloud | |
| 570 | core | ent_amb_wf_proto_02_cloud_va_wide | |
| 571 | core | ent_amb_wf_proto_02_cloud_var | |
| 572 | core | ent_amb_wf_proto_02_spray | |
| 573 | core | ent_amb_wf_proto_fog | |
| 574 | core | ent_amb_wf_soak | |
| 575 | core | ent_amb_wf_splash_base | |
| 576 | core | ent_amb_wf_splash_base_med | |
| 577 | core | ent_amb_wf_splash_base_sm | |
| 578 | core | ent_amb_wf_splash_cloud | |
| 579 | core | ent_amb_wf_splash_lg | |
| 580 | core | ent_amb_wf_splash_md | |
| 581 | core | ent_amb_wf_splash_sm | |
| 582 | core | ent_amb_wf_top_bits | |
| 583 | core | ent_amb_wf_whitewater | |
| 584 | core | ent_amb_wfall_strwb_base | |
| 585 | core | ent_amb_wfall_strwb_top | |
| 586 | core | ent_amb_wind_grass | |
| 587 | core | ent_amb_wind_grass_dir | |
| 588 | core | ent_amb_wind_hay | |
| 589 | core | ent_amb_wind_hay_dir | |
| 590 | core | ent_amb_wind_leaves | |
| 591 | core | ent_amb_wind_leaves_dir | |
| 592 | core | ent_amb_wind_leaves_swirl | |
| 593 | core | ent_amb_wind_litter | |
| 594 | core | ent_amb_wind_litter_dir | |
| 595 | core | ent_amb_wind_litter_dust | |
| 596 | core | ent_amb_wind_litter_dust_dir | |
| 597 | core | ent_amb_wind_litter_dust_swirl | |
| 598 | core | ent_amb_wind_litter_swirl | |
| 599 | core | ent_amb_wind_petal_tint_dir | |
| 600 | core | ent_amb_wind_rand_litter |