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 |
|---|---|---|---|
| 201 | anm_weapons | ent_anim_muz_pistol | |
| 202 | anm_weapons | ent_anim_muz_rifle | |
| 203 | anm_weapons | ent_anim_muzzle_flash_light | |
| 204 | scr_demo1 | scr_mud5_safe_exp_post | |
| 205 | scr_odr3 | scr_odr3_pour_gunpowder | |
| 206 | scr_odr3 | scr_odr3_surgery_gunpowder | |
| 207 | core | bang_ash | |
| 208 | core | bang_blood | |
| 209 | core | bang_carmetal | |
| 210 | core | bang_carmetal_no_sparks | |
| 211 | core | bang_clay | |
| 212 | core | bang_concrete | |
| 213 | core | bang_dirt_dry | |
| 214 | core | bang_dust | |
| 215 | core | bang_glass | |
| 216 | core | bang_gravel | |
| 217 | core | bang_hay | |
| 218 | core | bang_ice | |
| 219 | core | bang_leaves | |
| 220 | core | bang_leaves_ficus | |
| 221 | core | bang_leaves_maple | |
| 222 | core | bang_leaves_oak | |
| 223 | core | bang_manure | |
| 224 | core | bang_metal | |
| 225 | core | bang_metal_no_sparks | |
| 226 | core | bang_moss | |
| 227 | core | bang_mud | |
| 228 | core | bang_mud_soft | |
| 229 | core | bang_mud_underwater | |
| 230 | core | bang_ped_bushes | |
| 231 | core | bang_ped_foot_mud_soft | |
| 232 | core | bang_ped_foot_tar | |
| 233 | core | bang_ped_tree_pine | |
| 234 | core | bang_ped_tree_pine_snow | |
| 235 | core | bang_sand | |
| 236 | core | bang_sand_wet | |
| 237 | core | bang_slush | |
| 238 | core | bang_snow | |
| 239 | core | bang_tar | |
| 240 | core | bang_twigs | |
| 241 | core | bang_vegetation | |
| 242 | core | bang_wood | |
| 243 | core | blood_animal_maul | |
| 244 | core | blood_animal_maul_decal | |
| 245 | core | blood_animal_maul_mouth | |
| 246 | core | blood_blunt_weap_hit | |
| 247 | core | blood_dismember_corpse_hand | |
| 248 | core | blood_dismember_corpse_head | |
| 249 | core | blood_dismember_foot | |
| 250 | core | blood_dismember_hand | |
| 251 | core | blood_dismember_head | |
| 252 | core | blood_drip_head | |
| 253 | core | blood_entry | |
| 254 | core | blood_entry_corpse | |
| 255 | core | blood_entry_critical | |
| 256 | core | blood_entry_dead | |
| 257 | core | blood_entry_decal_pool | |
| 258 | core | blood_entry_head_fatal | |
| 259 | core | blood_entry_player | |
| 260 | core | blood_entry_underwater | |
| 261 | core | blood_exit | |
| 262 | core | blood_exit_critical | |
| 263 | core | blood_explosive_bullet | |
| 264 | core | blood_explosive_bullet_Med | |
| 265 | core | blood_fall | |
| 266 | core | blood_glancing | |
| 267 | core | blood_glancing_player | |
| 268 | core | blood_melee_hit | |
| 269 | core | blood_mist | |
| 270 | core | blood_ped_trample | |
| 271 | core | blood_small_animal_explode | |
| 272 | core | blood_train | |
| 273 | core | blood_wheel | |
| 274 | core | bul_bone | |
| 275 | core | bul_bushes | |
| 276 | core | bul_bushes_sapling | |
| 277 | core | bul_bushes_twigs | |
| 278 | core | bul_cactus | |
| 279 | core | bul_carmetal | |
| 280 | core | bul_ceramic | |
| 281 | core | bul_chickenfarm | |
| 282 | core | bul_cloth | |
| 283 | core | bul_concrete | |
| 284 | core | bul_decal_mud | |
| 285 | core | bul_decal_oil | |
| 286 | core | bul_decal_water | |
| 287 | core | bul_decal_water_gatling | |
| 288 | core | bul_decal_water_sg | |
| 289 | core | bul_dirt | |
| 290 | core | bul_exp_shrapnel_falling_dust | |
| 291 | core | bul_generic | |
| 292 | core | bul_generic_dusty | |
| 293 | core | bul_generic_liquidy | |
| 294 | core | bul_generic_overhang_falling_dust | |
| 295 | core | bul_glass | |
| 296 | core | bul_glass_thin | |
| 297 | core | bul_grass | |
| 298 | core | bul_grass_alt | |
| 299 | core | bul_grass_gatling | |
| 300 | core | bul_gravel |