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 |
|---|---|---|---|
| 601 | core | ent_amb_wind_snow_bendleft | |
| 602 | core | ent_amb_wind_snow_bendright | |
| 603 | core | ent_amb_wind_snow_drifts | |
| 604 | core | ent_amb_wind_snow_ground | |
| 605 | core | ent_amb_wind_snowfall | |
| 606 | core | ent_amb_wind_tree_leaves | |
| 607 | core | ent_amb_wwheel_strwb_base | |
| 608 | core | ent_amb_wwheel_strwb_top | |
| 609 | core | env_air_debris | |
| 610 | core | env_ash | |
| 611 | core | env_cloud | |
| 612 | core | env_desert_ground_dust | |
| 613 | core | env_dust_motes | |
| 614 | core | env_embers | |
| 615 | core | env_firefly_swarm | |
| 616 | core | env_firesmoke | |
| 617 | core | env_flies | |
| 618 | core | env_fog | |
| 619 | core | env_interior_dusty | |
| 620 | core | env_interiorsmoke | |
| 621 | core | env_pollen | |
| 622 | core | env_rain_mist | |
| 623 | core | env_sandstorm | |
| 624 | core | env_smoke | |
| 625 | core | env_swamp_flies | |
| 626 | core | env_wind_debris_city | |
| 627 | core | env_wind_debris_city_slum | |
| 628 | core | env_wind_debris_countryside | |
| 629 | core | env_wind_debris_desert | |
| 630 | core | env_wind_debris_industrial_ash | |
| 631 | core | env_wind_debris_mountain | |
| 632 | core | env_wind_debris_woodland | |
| 633 | core | env_wind_debris_woodland_pine | |
| 634 | core | env_wind_mountain_snow | |
| 635 | core | exp_grn_cloud | |
| 636 | core | exp_poison_bottle | |
| 637 | core | exp_sht_flame | |
| 638 | core | exp_sht_steam | |
| 639 | core | exp_water_spout | |
| 640 | core | fire_gunpowder_trail | |
| 641 | core | fire_map | |
| 642 | core | fire_oil_pool | |
| 643 | core | fire_oil_trail | |
| 644 | core | fire_ped_body | |
| 645 | core | fire_ped_limb | |
| 646 | core | fire_petrol_pool | |
| 647 | core | fire_petrol_script | |
| 648 | core | fire_petrol_trail | |
| 649 | core | fire_petroltank_car | |
| 650 | core | fire_spread_generic | |
| 651 | core | fire_spread_generic_obj | |
| 652 | core | fire_spread_generic_smoulder_loop | |
| 653 | core | fire_spread_generic_smoulder_obj | |
| 654 | core | fire_wheel | |
| 655 | core | fire_wrecked_boat | |
| 656 | core | fire_wrecked_car | |
| 657 | core | fire_wrecked_car_vent | |
| 658 | core | fire_wrecked_hot_air_balloon | |
| 659 | core | fire_wrecked_train | |
| 660 | core | liquid_leak_blood | |
| 661 | core | liquid_leak_flour | |
| 662 | core | liquid_leak_grain | |
| 663 | core | liquid_leak_gunpowder | |
| 664 | core | liquid_leak_kerosene | |
| 665 | core | liquid_leak_moonshine | |
| 666 | core | liquid_leak_oil | |
| 667 | core | liquid_leak_petrol | |
| 668 | core | liquid_leak_sand | |
| 669 | core | liquid_leak_sugar | |
| 670 | core | liquid_leak_water | |
| 671 | core | mtl_debris_dirt_light | |
| 672 | core | mtl_debris_dirt_medium | |
| 673 | core | mtl_debris_gravel_dirt_light | |
| 674 | core | mtl_debris_gravel_dirt_medium | |
| 675 | core | mtl_debris_gravel_heavy | |
| 676 | core | mtl_debris_gravel_light | |
| 677 | core | mtl_debris_gravel_medium | |
| 678 | core | mtl_debris_sand | |
| 679 | core | mtl_debris_snow_loose | |
| 680 | core | mtl_debris_woodchips | |
| 681 | core | mtl_disturb_dust | |
| 682 | core | mtl_disturb_grass | |
| 683 | core | mtl_disturb_gravel | |
| 684 | core | mtl_disturb_leaves | |
| 685 | core | mtl_disturb_mud | |
| 686 | core | mtl_disturb_snow_loose | |
| 687 | core | mtl_disturb_woodchips | |
| 688 | core | muz_moonshine | |
| 689 | core | muz_smoking_barrel | |
| 690 | core | muz_smoking_barrel_cannon | |
| 691 | core | muz_smoking_barrel_rifle | |
| 692 | core | muz_smoking_barrel_shotgun | |
| 693 | core | ped_bear_mouth_froth | |
| 694 | core | ped_blood_drips | |
| 695 | core | ped_blood_pool_water | |
| 696 | core | ped_body_heat_haze_horse | |
| 697 | core | ped_breath_fish_bubbles | |
| 698 | core | ped_breath_scuba | |
| 699 | core | ped_breath_water | |
| 700 | core | ped_corpse_flies |