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 |
|---|---|---|---|
| 301 | core | bul_gravel_grass | |
| 302 | core | bul_hay | |
| 303 | core | bul_leather | |
| 304 | core | bul_leaves | |
| 305 | core | bul_leaves_ficus | |
| 306 | core | bul_leaves_maple | |
| 307 | core | bul_leaves_oak | |
| 308 | core | bul_metal_chain | |
| 309 | core | bul_metal_small | |
| 310 | core | bul_mud | |
| 311 | core | bul_muddy_dirt | |
| 312 | core | bul_paper | |
| 313 | core | bul_plaster_brittle | |
| 314 | core | bul_plaster_brittle_alt | |
| 315 | core | bul_powder | |
| 316 | core | bul_sack | |
| 317 | core | bul_small_bird_feathers | |
| 318 | core | bul_snow_deep | |
| 319 | core | bul_stone | |
| 320 | core | bul_tobacco | |
| 321 | core | bul_water_debris_sp | |
| 322 | core | bul_wicker | |
| 323 | core | bul_wood_embers | |
| 324 | core | bul_wood_rotten | |
| 325 | core | bul_wood_solid_small | |
| 326 | core | bul_wood_splinter | |
| 327 | core | bul_wood_splinter_alt | |
| 328 | core | bul_wood_splinter_gatling | |
| 329 | core | bul_wood_splinter_gatling_alt | |
| 330 | core | bul_wood_splinter_sg | |
| 331 | core | eject_gatling | |
| 332 | core | eject_gatling_maxim | |
| 333 | core | eject_pistol_shell | |
| 334 | core | eject_repeater_shell | |
| 335 | core | eject_revolver | |
| 336 | core | eject_revolver_cattleman | |
| 337 | core | eject_revolver_shell | |
| 338 | core | eject_rifle | |
| 339 | core | eject_rifle_shell | |
| 340 | core | eject_shotgun | |
| 341 | core | eject_shotgun_db | |
| 342 | core | eject_shotgun_shell | |
| 343 | core | eject_sniper_shell | |
| 344 | core | ent_amb_elec_crackle_sp | |
| 345 | core | ent_amb_falling_debris | |
| 346 | core | ent_amb_falling_dust_debris | |
| 347 | core | ent_amb_falling_smoke | |
| 348 | core | ent_amb_falling_smoke_bam | |
| 349 | core | ent_amb_following_dust | |
| 350 | core | ent_amb_gutter_splash_spawn | |
| 351 | core | ent_amb_impact_interior | |
| 352 | core | ent_amb_insect_dragonfly | |
| 353 | core | ent_amb_insect_water_bug_bubbles | |
| 354 | core | ent_amb_match_ignite | |
| 355 | core | ent_amb_oil_drips_spawned | |
| 356 | core | ent_amb_sewer_drips_spawned | |
| 357 | core | ent_amb_swamp_bubbles | |
| 358 | core | ent_amb_tar_bubbles_broken | |
| 359 | core | ent_amb_trap_leaves | |
| 360 | core | ent_amb_tree_snowfall | |
| 361 | core | ent_amb_water_drips_spawned | |
| 362 | core | ent_amb_water_drips_spawned_sm_sound | |
| 363 | core | ent_amb_wind_cactus_dust | |
| 364 | core | ent_amb_wind_snow_drifts_tree_lrg | |
| 365 | core | ent_amb_wind_snow_drifts_tree_med | |
| 366 | core | ent_amb_wind_snow_drifts_tree_sma | |
| 367 | core | ent_amb_work_shovel_mud | |
| 368 | core | ent_anim_ann_coal_leak | |
| 369 | core | ent_brk_banknotes | |
| 370 | core | ent_brk_blood | |
| 371 | core | ent_brk_bone | |
| 372 | core | ent_brk_bread | |
| 373 | core | ent_brk_brick | |
| 374 | core | ent_brk_burning_crumble | |
| 375 | core | ent_brk_burning_ignite | |
| 376 | core | ent_brk_cactus | |
| 377 | core | ent_brk_candle | |
| 378 | core | ent_brk_ceramic | |
| 379 | core | ent_brk_clay | |
| 380 | core | ent_brk_cloth | |
| 381 | core | ent_brk_coins | |
| 382 | core | ent_brk_concrete | |
| 383 | core | ent_brk_concrete_large | |
| 384 | core | ent_brk_cotton | |
| 385 | core | ent_brk_dirt | |
| 386 | core | ent_brk_door_frame_dust | |
| 387 | core | ent_brk_door_lock | |
| 388 | core | ent_brk_dust | |
| 389 | core | ent_brk_embers | |
| 390 | core | ent_brk_feathers | |
| 391 | core | ent_brk_flammable | |
| 392 | core | ent_brk_flesh | |
| 393 | core | ent_brk_flowers | |
| 394 | core | ent_brk_glass | |
| 395 | core | ent_brk_glass_bottle | |
| 396 | core | ent_brk_grain | |
| 397 | core | ent_brk_gravel | |
| 398 | core | ent_brk_gravestone | |
| 399 | core | ent_brk_hay | |
| 400 | core | ent_brk_husk |