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 |
|---|---|---|---|
| 401 | core | ent_amb_insect_firefly_swarm | |
| 402 | core | ent_amb_insect_fly_swarm | |
| 403 | core | ent_amb_insect_fly_swarm_horse | |
| 404 | core | ent_amb_insect_fly_swarm_outhouse | |
| 405 | core | ent_amb_insect_fly_swarm_shit | |
| 406 | core | ent_amb_insect_fly_swarm_shit_tracking | |
| 407 | core | ent_amb_insect_grasshopper | |
| 408 | core | ent_amb_insect_maggots | |
| 409 | core | ent_amb_insect_moths_night | |
| 410 | core | ent_amb_insect_moths_night_window | |
| 411 | core | ent_amb_insect_moths_swarm | |
| 412 | core | ent_amb_insect_moths_swarm_lrg | |
| 413 | core | ent_amb_insect_nat_swarm | |
| 414 | core | ent_amb_insect_plane | |
| 415 | core | ent_amb_insect_swamp_flies | |
| 416 | core | ent_amb_insect_swarm | |
| 417 | core | ent_amb_insect_water_bugs | |
| 418 | core | ent_amb_int_fireplace | |
| 419 | core | ent_amb_int_fireplace_win1 | |
| 420 | core | ent_amb_int_smoke_lingering | |
| 421 | core | ent_amb_interior_show_fire | |
| 422 | core | ent_amb_light_message_fog | |
| 423 | core | ent_amb_maggots_bodyPartHead02 | |
| 424 | core | ent_amb_maggots_boneSkeleton02x | |
| 425 | core | ent_amb_maggots_carcassCow01 | |
| 426 | core | ent_amb_maggots_carcassHorse01x | |
| 427 | core | ent_amb_maggots_deadPokerPlayer01x | |
| 428 | core | ent_amb_maggots_s_abe_corpse01 | |
| 429 | core | ent_amb_match_flame | |
| 430 | core | ent_amb_mountain_cloud_01 | |
| 431 | core | ent_amb_mountain_cloud_02 | |
| 432 | core | ent_amb_oil_drips_med | |
| 433 | core | ent_amb_ped_fish_ripples | |
| 434 | core | ent_amb_pollen | |
| 435 | core | ent_amb_rapid_area_spray | |
| 436 | core | ent_amb_rapid_area_spray_hvy | |
| 437 | core | ent_amb_rapid_dir_splash | |
| 438 | core | ent_amb_rapid_dir_splash_light | |
| 439 | core | ent_amb_rapid_dir_splash_long | |
| 440 | core | ent_amb_rapid_dir_splash_short | |
| 441 | core | ent_amb_rapid_dir_splash_wide | |
| 442 | core | ent_amb_rapid_dir_spray | |
| 443 | core | ent_amb_rapid_rock_drips | |
| 444 | core | ent_amb_river_mist_gen | |
| 445 | core | ent_amb_river_rock_splash | |
| 446 | core | ent_amb_river_splash_gen | |
| 447 | core | ent_amb_robot_bulb | |
| 448 | core | ent_amb_robot_smoke | |
| 449 | core | ent_amb_robot_sparks | |
| 450 | core | ent_amb_rolling_boulder_dust | |
| 451 | core | ent_amb_room_haze | |
| 452 | core | ent_amb_sde_smokegroup_1 | |
| 453 | core | ent_amb_sde_smokegroup_2 | |
| 454 | core | ent_amb_sde_smokegroup_3 | |
| 455 | core | ent_amb_sde_smokegroup_4 | |
| 456 | core | ent_amb_sewer_drips_lg | |
| 457 | core | ent_amb_sewer_drips_med | |
| 458 | core | ent_amb_sewer_drips_sm | |
| 459 | core | ent_amb_shit_drip | |
| 460 | core | ent_amb_slaughter_sewer_discharge | |
| 461 | core | ent_amb_smoke_cabin | |
| 462 | core | ent_amb_smoke_cabin_distance | |
| 463 | core | ent_amb_smoke_chimney | |
| 464 | core | ent_amb_smoke_chimney_long | |
| 465 | core | ent_amb_smoke_chimney_var_01 | |
| 466 | core | ent_amb_smoke_chimney_win1 | |
| 467 | core | ent_amb_smoke_factory | |
| 468 | core | ent_amb_smoke_factory_exhaust | |
| 469 | core | ent_amb_smoke_factory_exhaust_sma | |
| 470 | core | ent_amb_smoke_factory_feed | |
| 471 | core | ent_amb_smoke_factory_interior | |
| 472 | core | ent_amb_smoke_factory_sma | |
| 473 | core | ent_amb_smoke_mine | |
| 474 | core | ent_amb_smoke_moon_still | |
| 475 | core | ent_amb_smoke_pipe_s | |
| 476 | core | ent_amb_smoke_pipe_spread | |
| 477 | core | ent_amb_smoke_pipe_spread_var_01 | |
| 478 | core | ent_amb_smoke_smolder | |
| 479 | core | ent_amb_smoke_stack_l_connector | |
| 480 | core | ent_amb_smoke_stack_l_mainstream | |
| 481 | core | ent_amb_smoke_stack_m_connector | |
| 482 | core | ent_amb_smoke_stack_m_mainstream | |
| 483 | core | ent_amb_smoke_stack_m_wind | |
| 484 | core | ent_amb_smoke_stack_s_scatter | |
| 485 | core | ent_amb_smoke_teepee_high | |
| 486 | core | ent_amb_smoke_teepee_low | |
| 487 | core | ent_amb_snow_drop | |
| 488 | core | ent_amb_snow_falling_dust_debris | |
| 489 | core | ent_amb_snow_mist_base | |
| 490 | core | ent_amb_snow_mist_upper | |
| 491 | core | ent_amb_snow_mountain_drifts | |
| 492 | core | ent_amb_snow_mountain_drifts_close | |
| 493 | core | ent_amb_snow_mountain_drifts_swirl | |
| 494 | core | ent_amb_snow_roof_drifts | |
| 495 | core | ent_amb_spring_bubbles | |
| 496 | core | ent_amb_stage_light_smoke | |
| 497 | core | ent_amb_steam_boat_engine | |
| 498 | core | ent_amb_steam_compost_piles | |
| 499 | core | ent_amb_steam_donkey_main | |
| 500 | core | ent_amb_steam_donkey_pipes |