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 |
|---|---|---|---|
| 701 | core | ped_dog_mouth_froth | |
| 702 | core | ped_foot_ash_horse_scuff | |
| 703 | core | ped_foot_ash_muddy_horse_scuff | |
| 704 | core | ped_foot_dirt_dry_horse_scuff | |
| 705 | core | ped_foot_dirt_muddy_horse_scuff | |
| 706 | core | ped_foot_dust_horse_scuff | |
| 707 | core | ped_foot_dust_scuff | |
| 708 | core | ped_foot_gravel_dirt_horse_scuff | |
| 709 | core | ped_foot_gravel_grass_horse_scuff | |
| 710 | core | ped_foot_gravel_horse_scuff | |
| 711 | core | ped_foot_gravel_muddy_horse_scuff | |
| 712 | core | ped_foot_gravel_scuff | |
| 713 | core | ped_foot_hay_scuff | |
| 714 | core | ped_foot_leaves_ficus_horse_scuff | |
| 715 | core | ped_foot_leaves_horse_scuff | |
| 716 | core | ped_foot_leaves_maple_horse_scuff | |
| 717 | core | ped_foot_leaves_oak_horse_scuff | |
| 718 | core | ped_foot_leaves_wet_ficus_horse_scuff | |
| 719 | core | ped_foot_leaves_wet_horse_scuff | |
| 720 | core | ped_foot_leaves_wet_maple_horse_scuff | |
| 721 | core | ped_foot_leaves_wet_oak_horse_scuff | |
| 722 | core | ped_foot_mud_soft_horse_scuff | |
| 723 | core | ped_foot_powder_horse_scuff | |
| 724 | core | ped_foot_sand_wet_horse_scuff | |
| 725 | core | ped_foot_snow_horse_scuff | |
| 726 | core | ped_foot_twigs_horse_scuff | |
| 727 | core | ped_foot_twigs_wet_horse_scuff | |
| 728 | core | ped_foot_water_horse_scuff | |
| 729 | core | ped_grd_disturb_dust | |
| 730 | core | ped_grd_disturb_dust_ash_horse_light | |
| 731 | core | ped_grd_disturb_dust_dirt_horse_heavy | |
| 732 | core | ped_grd_disturb_dust_dirt_horse_light | |
| 733 | core | ped_grd_disturb_dust_dirt_horse_medium | |
| 734 | core | ped_grd_disturb_dust_heavy | |
| 735 | core | ped_grd_disturb_mud_underwater | |
| 736 | core | ped_grd_disturb_snow | |
| 737 | core | ped_grd_disturb_snow_horse | |
| 738 | core | ped_grd_disturb_snow_loose | |
| 739 | core | ped_grd_disturb_snow_loose_horse | |
| 740 | core | ped_hatbrim_drip | |
| 741 | core | ped_horse_flaming_hoof | |
| 742 | core | ped_horse_mouth_froth | |
| 743 | core | ped_underwater_disturb_dirt | |
| 744 | core | ped_underwater_disturb_sand | |
| 745 | core | ped_underwater_trails | |
| 746 | core | ped_underwater_trails_horse | |
| 747 | core | ped_wade_mud | |
| 748 | core | ped_wade_mud_watery | |
| 749 | core | ped_wade_snow | |
| 750 | core | ped_wade_snow_horse | |
| 751 | core | ped_wade_snow_horse_mp | |
| 752 | core | ped_wade_snow_mp | |
| 753 | core | ped_wade_tar | |
| 754 | core | ped_wash_blood | |
| 755 | core | ped_wash_mud | |
| 756 | core | ped_water_drips | |
| 757 | core | ped_water_drips_horse | |
| 758 | core | ped_waterfall_collision | |
| 759 | core | proj_arrow_fire | |
| 760 | core | proj_arrow_fire_trail | |
| 761 | core | proj_arrow_trail | |
| 762 | core | proj_arrow_trail_custom | |
| 763 | core | proj_cannon_trail | |
| 764 | core | proj_disturb_dust | |
| 765 | core | proj_dynamite_fuse | |
| 766 | core | proj_dynamite_trail | |
| 767 | core | proj_molotov_flame | |
| 768 | core | proj_molotov_trail | |
| 769 | core | scr_winter1_barn_door_snow | |
| 770 | core | scrape_ash | |
| 771 | core | scrape_blood | |
| 772 | core | scrape_clay | |
| 773 | core | scrape_concrete | |
| 774 | core | scrape_dirt_dry | |
| 775 | core | scrape_dust | |
| 776 | core | scrape_glass | |
| 777 | core | scrape_gravel | |
| 778 | core | scrape_ice | |
| 779 | core | scrape_manure | |
| 780 | core | scrape_metal | |
| 781 | core | scrape_moss | |
| 782 | core | scrape_mud | |
| 783 | core | scrape_mud_soft | |
| 784 | core | scrape_mud_underwater | |
| 785 | core | scrape_ped_foot_mud_soft | |
| 786 | core | scrape_ped_grass | |
| 787 | core | scrape_ped_leaves | |
| 788 | core | scrape_ped_leaves_ficus | |
| 789 | core | scrape_ped_leaves_maple | |
| 790 | core | scrape_ped_leaves_oak | |
| 791 | core | scrape_ped_limb_mud_soft | |
| 792 | core | scrape_ped_snow | |
| 793 | core | scrape_ped_torso_mud_soft | |
| 794 | core | scrape_sand | |
| 795 | core | scrape_sand_wet | |
| 796 | core | scrape_slush | |
| 797 | core | scrape_snow | |
| 798 | core | scrape_twigs | |
| 799 | core | scrape_wood | |
| 800 | core | trail_splash_blood |