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 |
|---|---|---|---|
| 501 | core | ent_dst_jug | |
| 502 | core | ent_dst_jug_liquid | |
| 503 | core | ent_dst_lantern | |
| 504 | core | ent_dst_lantern_blast | |
| 505 | core | ent_dst_lantern_glass | |
| 506 | core | ent_dst_leather | |
| 507 | core | ent_dst_litter | |
| 508 | core | ent_dst_mail | |
| 509 | core | ent_dst_metal_can | |
| 510 | core | ent_dst_metal_frag | |
| 511 | core | ent_dst_metal_spark | |
| 512 | core | ent_dst_moonshine_jug | |
| 513 | core | ent_dst_newspaper | |
| 514 | core | ent_dst_office_paper | |
| 515 | core | ent_dst_peanuts | |
| 516 | core | ent_dst_pelt_fur | |
| 517 | core | ent_dst_plant_leaves | |
| 518 | core | ent_dst_poker_card | |
| 519 | core | ent_dst_poker_chip | |
| 520 | core | ent_dst_poop | |
| 521 | core | ent_dst_poop_splash | |
| 522 | core | ent_dst_pot | |
| 523 | core | ent_dst_pot_leaves | |
| 524 | core | ent_dst_rock | |
| 525 | core | ent_dst_rotten_fish | |
| 526 | core | ent_dst_rubbish | |
| 527 | core | ent_dst_rubble | |
| 528 | core | ent_dst_sand | |
| 529 | core | ent_dst_seat_pad | |
| 530 | core | ent_dst_snow | |
| 531 | core | ent_dst_snow_lrg | |
| 532 | core | ent_dst_snow_rails | |
| 533 | core | ent_dst_snow_tombs | |
| 534 | core | ent_dst_sparking_wires | |
| 535 | core | ent_dst_steam_pipe | |
| 536 | core | ent_dst_tobacco | |
| 537 | core | ent_dst_tobacco_dried | |
| 538 | core | ent_dst_tobacco_leaf | |
| 539 | core | ent_dst_tower_debris | |
| 540 | core | ent_dst_upholstery | |
| 541 | core | ent_dst_wet_sand | |
| 542 | core | ent_dst_wood_barrel | |
| 543 | core | ent_dst_wood_chunky | |
| 544 | core | ent_dst_wood_planks | |
| 545 | core | ent_dst_wood_splinter | |
| 546 | core | ent_dst_wood_spoke | |
| 547 | core | ent_dst_wood_structure | |
| 548 | core | ent_dst_yarrow | |
| 549 | core | ent_dst_yarrow_slw | |
| 550 | core | ent_exp_bone | |
| 551 | core | ent_exp_concrete | |
| 552 | core | ent_exp_cotton_bale | |
| 553 | core | ent_exp_cotton_bale_sm | |
| 554 | core | ent_exp_wood | |
| 555 | core | ent_exp_wood_barrel | |
| 556 | core | ent_exp_wood_barrel_liquid | |
| 557 | core | ent_exp_wood_crate | |
| 558 | core | ent_exp_wood_fence | |
| 559 | core | ent_exp_wood_fence_med | |
| 560 | core | ent_exp_wood_post | |
| 561 | core | ent_ray_mud2_window_smash | |
| 562 | core | ent_sht_bear_trap | |
| 563 | core | ent_sht_beer_barrel | |
| 564 | core | ent_sht_beer_barrel_splash | |
| 565 | core | ent_sht_blood | |
| 566 | core | ent_sht_blood_splash | |
| 567 | core | ent_sht_bone | |
| 568 | core | ent_sht_bush_foliage | |
| 569 | core | ent_sht_cactus | |
| 570 | core | ent_sht_cardboard | |
| 571 | core | ent_sht_cotton_bale | |
| 572 | core | ent_sht_electrical_box | |
| 573 | core | ent_sht_fabric | |
| 574 | core | ent_sht_feathers | |
| 575 | core | ent_sht_flame | |
| 576 | core | ent_sht_flour_sack | |
| 577 | core | ent_sht_flower_petals | |
| 578 | core | ent_sht_gloopy_liquid | |
| 579 | core | ent_sht_grain_sack | |
| 580 | core | ent_sht_hay | |
| 581 | core | ent_sht_kerosene | |
| 582 | core | ent_sht_milk | |
| 583 | core | ent_sht_moonshine | |
| 584 | core | ent_sht_moonshine_moving | |
| 585 | core | ent_sht_oil | |
| 586 | core | ent_sht_paper_bails | |
| 587 | core | ent_sht_pillow | |
| 588 | core | ent_sht_rock | |
| 589 | core | ent_sht_rubbish | |
| 590 | core | ent_sht_sandbag | |
| 591 | core | ent_sht_snow_covered_bark | |
| 592 | core | ent_sht_snow_covered_tree | |
| 593 | core | ent_sht_sparking_wires | |
| 594 | core | ent_sht_steam | |
| 595 | core | ent_sht_steam_still | |
| 596 | core | ent_sht_sugar_sack | |
| 597 | core | ent_sht_telegraph_pole | |
| 598 | core | ent_sht_water | |
| 599 | core | ent_sht_water_tower | |
| 600 | core | ent_sht_window_glass |