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 |
|---|---|---|---|
| 401 | core | ent_brk_ice | |
| 402 | core | ent_brk_jug | |
| 403 | core | ent_brk_lantern | |
| 404 | core | ent_brk_lantern_glass | |
| 405 | core | ent_brk_leather | |
| 406 | core | ent_brk_metal_frag | |
| 407 | core | ent_brk_metal_spark | |
| 408 | core | ent_brk_moonshine | |
| 409 | core | ent_brk_paper | |
| 410 | core | ent_brk_pelt_fur | |
| 411 | core | ent_brk_poop | |
| 412 | core | ent_brk_rock | |
| 413 | core | ent_brk_rubble | |
| 414 | core | ent_brk_sand | |
| 415 | core | ent_brk_sparking_wires | |
| 416 | core | ent_brk_steam_burst | |
| 417 | core | ent_brk_steam_pipe | |
| 418 | core | ent_brk_tobacco | |
| 419 | core | ent_brk_tree_leaves | |
| 420 | core | ent_brk_tree_trunk_bark | |
| 421 | core | ent_brk_upholstery | |
| 422 | core | ent_brk_uprooted | |
| 423 | core | ent_brk_wood_planks | |
| 424 | core | ent_brk_wood_splinter | |
| 425 | core | ent_col_bush_leaves | |
| 426 | core | ent_col_electrical | |
| 427 | core | ent_col_falling_snow | |
| 428 | core | ent_col_gen_tree_dust | |
| 429 | core | ent_col_palm_leaves | |
| 430 | core | ent_col_rocks | |
| 431 | core | ent_col_tree_leaves | |
| 432 | core | ent_col_tree_leaves_birch | |
| 433 | core | ent_col_tree_leaves_ficus | |
| 434 | core | ent_col_tree_leaves_maple | |
| 435 | core | ent_col_tree_leaves_oak | |
| 436 | core | ent_col_tree_leaves_pine | |
| 437 | core | ent_dst_blood | |
| 438 | core | ent_dst_bone | |
| 439 | core | ent_dst_box_nails | |
| 440 | core | ent_dst_bread | |
| 441 | core | ent_dst_brick | |
| 442 | core | ent_dst_brick_vertical | |
| 443 | core | ent_dst_bronte_win | |
| 444 | core | ent_dst_burning_crumble | |
| 445 | core | ent_dst_burning_ignite | |
| 446 | core | ent_dst_cactus | |
| 447 | core | ent_dst_candle | |
| 448 | core | ent_dst_candy_jar | |
| 449 | core | ent_dst_carmetal | |
| 450 | core | ent_dst_ceramic_vase | |
| 451 | core | ent_dst_ceramics | |
| 452 | core | ent_dst_chick_carcass | |
| 453 | core | ent_dst_cig_packets | |
| 454 | core | ent_dst_cigarette | |
| 455 | core | ent_dst_clay | |
| 456 | core | ent_dst_clock_metal | |
| 457 | core | ent_dst_cloth | |
| 458 | core | ent_dst_concrete | |
| 459 | core | ent_dst_concrete_large | |
| 460 | core | ent_dst_concrete_pillar | |
| 461 | core | ent_dst_concrete_pillar_linger | |
| 462 | core | ent_dst_cotton | |
| 463 | core | ent_dst_dirt | |
| 464 | core | ent_dst_dreamcatcher | |
| 465 | core | ent_dst_dust | |
| 466 | core | ent_dst_egg | |
| 467 | core | ent_dst_electrical | |
| 468 | core | ent_dst_embers | |
| 469 | core | ent_dst_feather | |
| 470 | core | ent_dst_feathers | |
| 471 | core | ent_dst_flammable | |
| 472 | core | ent_dst_flesh | |
| 473 | core | ent_dst_flowers | |
| 474 | core | ent_dst_gen_cardboard | |
| 475 | core | ent_dst_gen_food | |
| 476 | core | ent_dst_gen_liquid_burst | |
| 477 | core | ent_dst_gen_paper | |
| 478 | core | ent_dst_gen_veg | |
| 479 | core | ent_dst_gen_veg_pulp | |
| 480 | core | ent_dst_gen_veg_small | |
| 481 | core | ent_dst_gen_veg_small_pulp | |
| 482 | core | ent_dst_gen_water_spray | |
| 483 | core | ent_dst_glass | |
| 484 | core | ent_dst_glass_bottles | |
| 485 | core | ent_dst_glass_bottles_beer | |
| 486 | core | ent_dst_glass_bulb | |
| 487 | core | ent_dst_glass_headlight | |
| 488 | core | ent_dst_glass_liquid | |
| 489 | core | ent_dst_glass_medicine | |
| 490 | core | ent_dst_glass_moonshine | |
| 491 | core | ent_dst_glass_round_lrg | |
| 492 | core | ent_dst_gourd | |
| 493 | core | ent_dst_grain | |
| 494 | core | ent_dst_gravel | |
| 495 | core | ent_dst_gravestone | |
| 496 | core | ent_dst_hanging_herb | |
| 497 | core | ent_dst_hay | |
| 498 | core | ent_dst_husk | |
| 499 | core | ent_dst_ice | |
| 500 | core | ent_dst_icicle |