RedM Natives

Ped commands for selecting anim variations

Notes from the author
 These are commands for activating clips variation for enter, base or exit conditional anims within some scenario.
 
 
 Citizen.CreateThread(function()
 	while true do
  		Citizen.Wait(0)
  		if Citizen.InvokeNative(0x91AEF906BCA88877,0, 0x17BEC168) then   -- pressed E
 			-- TASK_START_SCENARIO_IN_PLACE_HASH with conditional anim PROP_HUMAN_SEAT_CHAIR_GENERIC_MALE_A. Works for male player peds:
 			Citizen.InvokeNative(0x524B54361229154F, PlayerPedId(), GetHashKey("PROP_HUMAN_SEAT_CHAIR"), 0, 1, GetHashKey("PROP_HUMAN_SEAT_CHAIR_GENERIC_MALE_A"), -1.0, 0)
 		end
 		if Citizen.InvokeNative(0x91AEF906BCA88877,0, 0x956C2A0E) then   -- pressed R
 			local ped_command_hash=GetHashKey("EAFOR_A_L_ANGRY")  -- -- to play angry exit animation to the left side or GetHashKey(""EAFOR_A_R_ANGRY") to play angry exit animation to the right side
 			local ped_command_hash_activation_duration=50.0   -- 50 seconds
 			-- _ACTIVATE_PED_COMMAND_HASH (as result, if ped EXITS scenario, it plays animations activated by ped command hash "EAFOR_A_L_ANGRY")
 			Citizen.InvokeNative(0xD65FDC686A031C83, PlayerPedId(), ped_command_hash, ped_command_hash_activation_duration) 
 			 -- _FORCE_SCENARIO_TRANSITION:
 			Citizen.InvokeNative(0x6D07B371E9439019, PlayerPedId() )
			-- CLEAR_PED_TASKS (as result we force ped to properly exit scenario and play animations activated by ped command hash EAFOR_A_L_ANGRY)
			Citizen.InvokeNative(0xE1EF3C1216AFF2CD, PlayerPedId(), 0, 0)
 		end
 	end
 end)
 local ped_commands = {
 	{conditional_anim_name, anim_variations_type, ped_command_hash,},
 }
3 rows
#keyvalueNote
1conditional_anim_nameEA_WORLD_HUMAN_TREE_CHOP_NEW_WORKING_PRE_SWING
2anim_variations_typeExitAnim
3ped_command_hashEXIT_TREE_FALL