Particle FX (non-looped)
Notes from the author
EXAMPLE. MAKE FIREWORK BURST FROM YOUR PED:
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
local new_ptfx_dictionary = "scr_lom_train"
local new_ptfx_name = "scr_ind1_firework_burst"
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 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(0xE6CFE43937061143,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) -- StartNetworkedParticleFxNonLoopedOnEntity
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_non_looped = {
[ptfx_dictionary] = {ptfx_name},
}| # | dictionary | effect | Note |
|---|---|---|---|
| 601 | core | exp_air_dynamite | |
| 602 | core | exp_air_dynamite_volatile | |
| 603 | core | exp_air_firebottle | |
| 604 | core | exp_air_firebottle_volatile | |
| 605 | core | exp_bullet | |
| 606 | core | exp_dynamite_crates | |
| 607 | core | exp_grd_cannon | |
| 608 | core | exp_grd_dynamite | |
| 609 | core | exp_grd_dynamite_placed | |
| 610 | core | exp_grd_dynamite_volatile | |
| 611 | core | exp_grd_lantern | |
| 612 | core | exp_grd_moonshine | |
| 613 | core | exp_grd_moonshine_trails_spawn | |
| 614 | core | exp_grd_smoke_post | |
| 615 | core | exp_grd_smoke_post_small | |
| 616 | core | exp_grd_smoke_post_volatile | |
| 617 | core | exp_incendiary_bullet | |
| 618 | core | exp_lantern_flame_sp | |
| 619 | core | exp_lightning_strike | |
| 620 | core | exp_mtl_concrete | |
| 621 | core | exp_mtl_dirt | |
| 622 | core | exp_mtl_feather | |
| 623 | core | exp_mtl_flame | |
| 624 | core | exp_mtl_flesh | |
| 625 | core | exp_mtl_glass | |
| 626 | core | exp_mtl_grass | |
| 627 | core | exp_mtl_leaves | |
| 628 | core | exp_mtl_metal | |
| 629 | core | exp_mtl_mud | |
| 630 | core | exp_mtl_snow | |
| 631 | core | exp_mtl_wood | |
| 632 | core | exp_smoke_trail | |
| 633 | core | exp_smoke_trail_volatile | |
| 634 | core | exp_tracking_arrow | |
| 635 | core | exp_water | |
| 636 | core | exp_water_spout_decals_sp | |
| 637 | core | exp_wood_barrel_liquid_spawner_sp | |
| 638 | core | exp_wood_debris | |
| 639 | core | fire_ped_smoulder | |
| 640 | core | gun_barrel_eject_smoke | |
| 641 | core | gun_hammer_lemat | |
| 642 | core | gun_hammer_revolver | |
| 643 | core | liquid_splash_gloopy | |
| 644 | core | liquid_splash_milk | |
| 645 | core | liquid_splash_oil | |
| 646 | core | liquid_splash_petrol | |
| 647 | core | liquid_splash_water | |
| 648 | core | mech_ped_sparks | |
| 649 | core | mel_grass | |
| 650 | core | mel_metal | |
| 651 | core | mel_wood | |
| 652 | core | mel_wood_rotten | |
| 653 | core | mtl_debris_fallen_gravel_heavy | |
| 654 | core | mtl_debris_fallen_gravel_light | |
| 655 | core | mtl_debris_fallen_gravel_medium | |
| 656 | core | muz_cannon | |
| 657 | core | muz_gatling | |
| 658 | core | muz_revolver | |
| 659 | core | muz_revolver_fp | |
| 660 | core | muz_rifle | |
| 661 | core | muz_rifle_elephant | |
| 662 | core | muz_rifle_fp | |
| 663 | core | muz_shotgun | |
| 664 | core | ped_breath | |
| 665 | core | ped_breath_bear | |
| 666 | core | ped_breath_dog | |
| 667 | core | ped_breath_horse | |
| 668 | core | ped_foot_ash | |
| 669 | core | ped_foot_ash_horse | |
| 670 | core | ped_foot_ash_horse_lift | |
| 671 | core | ped_foot_ash_muddy | |
| 672 | core | ped_foot_ash_muddy_horse | |
| 673 | core | ped_foot_ash_muddy_horse_lift | |
| 674 | core | ped_foot_blood_pool | |
| 675 | core | ped_foot_blood_pool_animal | |
| 676 | core | ped_foot_blood_pool_horse | |
| 677 | core | ped_foot_blood_pool_lift | |
| 678 | core | ped_foot_coal | |
| 679 | core | ped_foot_coal_wet | |
| 680 | core | ped_foot_dirt_dry | |
| 681 | core | ped_foot_dirt_dry_animal | |
| 682 | core | ped_foot_dirt_dry_horse | |
| 683 | core | ped_foot_dirt_dry_horse_lift | |
| 684 | core | ped_foot_dirt_grass_horse | |
| 685 | core | ped_foot_dirt_muddy | |
| 686 | core | ped_foot_dirt_muddy_horse | |
| 687 | core | ped_foot_dirt_underwater | |
| 688 | core | ped_foot_dust | |
| 689 | core | ped_foot_dust_animal | |
| 690 | core | ped_foot_dust_bear | |
| 691 | core | ped_foot_dust_horse | |
| 692 | core | ped_foot_grass_horse | |
| 693 | core | ped_foot_grass_short_horse | |
| 694 | core | ped_foot_gravel | |
| 695 | core | ped_foot_gravel_animal | |
| 696 | core | ped_foot_gravel_dirt | |
| 697 | core | ped_foot_gravel_dirt_horse | |
| 698 | core | ped_foot_gravel_grass_horse | |
| 699 | core | ped_foot_gravel_horse | |
| 700 | core | ped_foot_gravel_muddy |