RedM Natives

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},
 }
1,176 rows
#dictionaryeffectNote
1101scr_winter4proj_dynamite_trail
1102scr_winter4scr_winter4_horse_disturb_dust
1103scr_beat_murder_for_hirescr_beat_mur_blood_spray
1104scr_smuggler2proj_cannon_trail
1105scr_beat_animal_maulingscr_beat_anml_blood_spray
1106anm_smokingcs_cig_smoke
1107anm_smokingcs_cig_smoke_inhale
1108anm_smokingent_anim_cig_smoke
1109anm_smokingent_anim_cig_smoke_cigar
1110anm_smokingent_anim_cig_smoke_cigar_ember
1111anm_smokingent_anim_cig_smoke_ember
1112anm_smokingent_anim_cig_smoke_preload
1113anm_smokingent_anim_cig_smoke_trail
1114anm_smokingent_anim_cig_smoke_walking
1115anm_smokingent_anim_matchstick_flame
1116anm_smokingent_anim_rccig_linger_smoke
1117des_gry1_mnshine_expent_ray_gry1_water_splash
1118markers_coreent_amb_net_race_fire
1119markers_coreent_amb_net_race_smoke
1120markers_coreent_amb_net_race_smoke_target
1121markers_corescr_net_race_arrow
1122scr_adv_ova_hunterscr_hunter_cloak_haze_head
1123scr_adv_ova_hunterscr_hunter_cloak_haze_limb
1124scr_adv_ova_hunterscr_hunter_cloak_haze_torso
1125anm_chamberpotent_anim_chamberpot_toss
1126anm_chamberpotent_anim_chamberpot_toss_short
1127scr_rcm_native2scr_natv3_fire_oil_field
1128scr_rcm_native2scr_natv3_fire_oil_plume
1129scr_rcm_native2scr_natv3_generic_fire
1130scr_adv_phscr_adv_ph_glow_plinth
1131scr_adv_phscr_adv_ph_glow_bag
1132scr_adv_phscr_adv_ph_glow_bag_rear
1133scr_adv_phscr_adv_ph_glow_head
1134scr_adv_phscr_adv_ph_glow_limb
1135scr_adv_phscr_adv_ph_glow_plinth
1136scr_adv_phscr_adv_ph_glow_torso
1137scr_odr3scr_odr3_blood_spurt
1138scr_odr3scr_odr3_surgery_heat
1139scr_deadeyescr_de_conviction_weapon_glow
1140scr_deadeyescr_de_focus_tracer
1141scr_deadeyescr_de_recuperate_wisps
1142scr_deadeyescr_de_slippery_haze_head
1143scr_deadeyescr_de_slippery_haze_limb
1144scr_deadeyescr_de_slippery_haze_torso
1145scr_deadeyescr_de_steady_smoke_torso
1146scr_deadeyescr_de_watch_wisps
1147scr_demo1proj_dynamite_trail
1148scr_net_fmescr_fme_corpse_fly_swarm
1149anm_gang2ent_anim_gng2_balloon_leaves
1150anm_gang2ent_anim_gng2_balloon_mud_scrape
1151anm_gang2ent_anim_gng2_balloon_wtr_spl
1152scr_beat_bear_trapscr_beat_bear_blood_spray
1153scr_ind1scr_ind1_firework
1154scr_ind1scr_ind1_firework_lights
1155scr_net_dynamiteproj_dynamite_trail
1156scr_train_robbery3scr_trn3_water_splash_surface
1157scr_trelawny1scr_trelawny1_smoke
1158scr_net_race_checkpointsscr_mp_item_pickup_highlight
1159scr_net_race_checkpointsscr_net_race_slipstream
1160scr_vantage_pointscr_event_glint
1161scr_fussar1scr_fus1_lantern_fire
1162scr_fussar1scr_fussar1_cave_steam
1163scr_fussar1scr_fussar1_dust_cloud
1164scr_fussar1scr_fussar1_dust_fog
1165scr_fussar1scr_fussar1_dusty_interior
1166scr_fussar1scr_fussar1_sb_short
1167scr_fussar1trail_splash_oil
1168scr_braithwaites3scr_braithw3_curtain_fire_01
1169scr_braithwaites3scr_braithw3_hall_smoke
1170scr_braithwaites3scr_braithw3_mansion_fire_crawling
1171scr_braithwaites3scr_braithw3_mansion_fire_under
1172scr_braithwaites3scr_braithw3_mansion_fire_win1
1173scr_braithwaites3scr_braithw3_mansion_fire_win2
1174scr_braithwaites3scr_braithw3_room_ash
1175scr_braithwaites3scr_braithw3_room_embers
1176scr_braithwaites3scr_braithw3_room_smoke_01