Player rips off parachute (tries to un-holster weapon)

So the title kind of explains it. It seems like every time a player has a weapon equipped in my server, specially a pistol, taser, etc. Once the parachute is deployed, the player model goes into the un-holster animation and tries to pull out a gun, in turn, removing the parachute from the player and causing them to fall to their death.

Is there a fix for this? Should I look in the un-holster animation resource since it seems to be triggering that resource?

Hey, same problem here. Is in ESX something triggering it? O.o

So I figured out it’s the holsterweapon resource. I was able to fix the problem, but now every weapon is going through the unholster animation and I don’t know how to make that stop lol

Whatever resource you are using, check before

if GetParachuteState(GetPlayerPed(-1)) < 1 then 
 --> animation
end

This is what I got

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		loadAnimDict("rcmjosh4")
		loadAnimDict("reaction@intimidation@cop@unarmed")
		loadAnimDict("reaction@intimidation@1h")
		local ped = PlayerPedId()

		if PlayerData.job ~= nil and PlayerData.job.name == 'police' then
			if not IsPedInAnyVehicle(ped, false) then
				if GetVehiclePedIsTryingToEnter (ped) == 0 and not IsPedInParachuteFreeFall (ped) then
					--if CheckWeapon(ped) then
						if IsPedArmed(ped, 4) then
						if holstered then
							blocked   = true
								TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "intro", 8.0, 2.0, -1, 50, 2.0, 0, 0, 0 ) -- Change 50 to 30 if you want to stand still when removing weapon
								--TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "intro", 8.0, 2.0, -1, 30, 2.0, 0, 0, 0 ) Use this line if you want to stand still when removing weapon
									Citizen.Wait(Config.CooldownPolice)
								TaskPlayAnim(ped, "rcmjosh4", "josh_leadout_cop2", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
									Citizen.Wait(400)
								ClearPedTasks(ped)
							holstered = false
						else
							blocked = false
						end
					else
					--elseif not IsPedArmed(ped, 4) then
						if not holstered then
					
								TaskPlayAnim(ped, "rcmjosh4", "josh_leadout_cop2", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
									Citizen.Wait(500)
								TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "outro", 8.0, 2.0, -1, 50, 2.0, 0, 0, 0 ) -- Change 50 to 30 if you want to stand still when holstering weapon
								--TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "outro", 8.0, 2.0, -1, 30, 2.0, 0, 0, 0 ) Use this line if you want to stand still when holstering weapon
									Citizen.Wait(60)
								ClearPedTasks(ped)
							holstered = true
						end
					end
				else
					SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
				end
			else
				holstered = true
			end
		else
			if not IsPedInAnyVehicle(ped, false) then
				if GetVehiclePedIsTryingToEnter (ped) == 0 and not IsPedInParachuteFreeFall (ped) then
					--if CheckWeapon(ped) then
						if IsPedArmed(ped, 4) then
						if holstered then
							blocked   = true
								TaskPlayAnim(ped, "reaction@intimidation@1h", "intro", 5.0, 1.0, -1, 50, 0, 0, 0, 0 )
								--TaskPlayAnim(ped, "reaction@intimidation@1h", "intro", 5.0, 1.0, -1, 30, 0, 0, 0, 0 ) Use this line if you want to stand still when removing weapon
									Citizen.Wait(Config.cooldown)
								ClearPedTasks(ped)
							holstered = false
						else
							blocked = false
						end
					else
					--elseif not IsPedArmed(ped, 4) then
						if not holstered then
								TaskPlayAnim(ped, "reaction@intimidation@1h", "outro", 8.0, 3.0, -1, 50, 0, 0, 0.125, 0 ) -- Change 50 to 30 if you want to stand still when holstering weapon
								--TaskPlayAnim(ped, "reaction@intimidation@1h", "outro", 8.0, 3.0, -1, 30, 0, 0, 0.125, 0 ) Use this line if you want to stand still when holstering weapon
									Citizen.Wait(1700)
								ClearPedTasks(ped)
							holstered = true
						end
					end
				else
					SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
				end
			else
				holstered = true
			end
		end
	end
end)

try that

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		loadAnimDict("rcmjosh4")
		loadAnimDict("reaction@intimidation@cop@unarmed")
		loadAnimDict("reaction@intimidation@1h")
		local ped = PlayerPedId()
		if GetPedParachuteState(ped) < 1 then 
			if PlayerData.job ~= nil and PlayerData.job.name == 'police' then
				if not IsPedInAnyVehicle(ped, false) then
					if GetVehiclePedIsTryingToEnter (ped) == 0 and not IsPedInParachuteFreeFall (ped) then
						--if CheckWeapon(ped) then
							if IsPedArmed(ped, 4) then
							if holstered then
								blocked   = true
									TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "intro", 8.0, 2.0, -1, 50, 2.0, 0, 0, 0 ) -- Change 50 to 30 if you want to stand still when removing weapon
									--TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "intro", 8.0, 2.0, -1, 30, 2.0, 0, 0, 0 ) Use this line if you want to stand still when removing weapon
										Citizen.Wait(Config.CooldownPolice)
									TaskPlayAnim(ped, "rcmjosh4", "josh_leadout_cop2", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
										Citizen.Wait(400)
									ClearPedTasks(ped)
								holstered = false
							else
								blocked = false
							end
						else
						--elseif not IsPedArmed(ped, 4) then
							if not holstered then
						
									TaskPlayAnim(ped, "rcmjosh4", "josh_leadout_cop2", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
										Citizen.Wait(500)
									TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "outro", 8.0, 2.0, -1, 50, 2.0, 0, 0, 0 ) -- Change 50 to 30 if you want to stand still when holstering weapon
									--TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "outro", 8.0, 2.0, -1, 30, 2.0, 0, 0, 0 ) Use this line if you want to stand still when holstering weapon
										Citizen.Wait(60)
									ClearPedTasks(ped)
								holstered = true
							end
						end
					else
						SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
					end
				else
					holstered = true
				end
			else
				if not IsPedInAnyVehicle(ped, false) then
					if GetVehiclePedIsTryingToEnter (ped) == 0 and not IsPedInParachuteFreeFall (ped) then
						--if CheckWeapon(ped) then
							if IsPedArmed(ped, 4) then
							if holstered then
								blocked   = true
									TaskPlayAnim(ped, "reaction@intimidation@1h", "intro", 5.0, 1.0, -1, 50, 0, 0, 0, 0 )
									--TaskPlayAnim(ped, "reaction@intimidation@1h", "intro", 5.0, 1.0, -1, 30, 0, 0, 0, 0 ) Use this line if you want to stand still when removing weapon
										Citizen.Wait(Config.cooldown)
									ClearPedTasks(ped)
								holstered = false
							else
								blocked = false
							end
						else
						--elseif not IsPedArmed(ped, 4) then
							if not holstered then
									TaskPlayAnim(ped, "reaction@intimidation@1h", "outro", 8.0, 3.0, -1, 50, 0, 0, 0.125, 0 ) -- Change 50 to 30 if you want to stand still when holstering weapon
									--TaskPlayAnim(ped, "reaction@intimidation@1h", "outro", 8.0, 3.0, -1, 30, 0, 0, 0.125, 0 ) Use this line if you want to stand still when holstering weapon
										Citizen.Wait(1700)
									ClearPedTasks(ped)
								holstered = true
							end
						end
					else
						SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
					end
				else
					holstered = true
				end
			end
		end
	end
end)

Right, so no change. Still having the issue where things like ARs, Shotguns, Snipers, etc. are all being unholstered like pistols :confused:

Try this guy … (lucasss-weaponanimations, not mine!!)

local weapons = {
	"WEAPON_KNIFE",
	"WEAPON_NIGHTSTICK",
	"WEAPON_HAMMER",
	"WEAPON_BAT",
	"WEAPON_GOLFCLUB",
	"WEAPON_CROWBAR",
	"WEAPON_BOTTLE",
	"WEAPON_DAGGER",
	"WEAPON_HATCHET",
	"WEAPON_MACHETE",
	"WEAPON_SWITCHBLADE",
	"WEAPON_BATTLEAXE",
	"WEAPON_POOLCUE",
	"WEAPON_WRENCH",
	"WEAPON_PISTOL",
	"WEAPON_COMBATPISTOL",
	"WEAPON_APPISTOL",
	"WEAPON_PISTOL50",
	"WEAPON_REVOLVER",
	"WEAPON_SNSPISTOL",
	"WEAPON_HEAVYPISTOL",
	"WEAPON_VINTAGEPISTOL",
	"WEAPON_MICROSMG",
	"WEAPON_SMG",
	"WEAPON_ASSAULTSMG",
	"WEAPON_MINISMG",
	"WEAPON_MACHINEPISTOL",
	"WEAPON_COMBATPDW",
	"WEAPON_PUMPSHOTGUN",
	"WEAPON_SAWNOFFSHOTGUN",
	"WEAPON_ASSAULTSHOTGUN",
	"WEAPON_BULLPUPSHOTGUN",
	"WEAPON_HEAVYSHOTGUN",
	"WEAPON_ASSAULTRIFLE",
	"WEAPON_CARBINERIFLE",
	"WEAPON_ADVANCEDRIFLE",
	"WEAPON_SPECIALCARBINE",
	"WEAPON_BULLPUPRIFLE",
	"WEAPON_COMPACTRIFLE",
	"WEAPON_MG",
	"WEAPON_COMBATMG",
	"WEAPON_GUSENBERG",
	"WEAPON_SNIPERRIFLE",
	"WEAPON_HEAVYSNIPER",
	"WEAPON_MARKSMANRIFLE",
	"WEAPON_GRENADELAUNCHER",
	"WEAPON_RPG",
	"WEAPON_STINGER",
	"WEAPON_MINIGUN",
	"WEAPON_GRENADE",
	"WEAPON_STICKYBOMB",
	"WEAPON_SMOKEGRENADE",
	"WEAPON_BZGAS",
	"WEAPON_MOLOTOV",
	"WEAPON_DIGISCANNER",
	"WEAPON_FIREWORK",
	"WEAPON_MUSKET",
	"WEAPON_STUNGUN",
	"WEAPON_HOMINGLAUNCHER",
	"WEAPON_PROXMINE",
	"WEAPON_FLAREGUN",
	"WEAPON_MARKSMANPISTOL",
	"WEAPON_RAILGUN",
	"WEAPON_DBSHOTGUN",
	"WEAPON_AUTOSHOTGUN",
	"WEAPON_COMPACTLAUNCHER",
	"WEAPON_PIPEBOMB",
	"WEAPON_DOUBLEACTION"
}

local holstered = true
local canfire = true
local currWeapon = nil
local playerPed

Citizen.CreateThread(
	function()
		while true do
			Citizen.Wait(0)
			if DoesEntityExist(playerPed) and not IsEntityDead(playerPed) and not IsPedInAnyVehicle(PlayerPedId(-1), true) then
				if currWeapon ~= GetSelectedPedWeapon(playerPed) then
					pos = GetEntityCoords(playerPed, true)
					rot = GetEntityHeading(playerPed)

					local newWeap = GetSelectedPedWeapon(playerPed)
					SetCurrentPedWeapon(playerPed, currWeapon, true)
					loadAnimDict("reaction@intimidation@1h")

					if CheckWeapon(newWeap) then
						if GetPedParachuteState(playerPed) < 1 then 
							if holstered then
								canFire = false
								TaskPlayAnimAdvanced(playerPed, "reaction@intimidation@1h", "intro", GetEntityCoords(playerPed, true), 0, 0, rot, 8.0, 3.0, -1, 50, 0.325, 0, 0)
								SetCurrentPedWeapon(playerPed, newWeap, true)
								Citizen.Wait(600)
								ClearPedTasks(playerPed)
								holstered = false
								canFire = true
								currWeapon = newWeap
							elseif newWeap ~= currWeapon then
								canFire = false
								TaskPlayAnimAdvanced(playerPed, "reaction@intimidation@1h", "outro", GetEntityCoords(playerPed, true), 0, 0, rot, 8.0, 3.0, -1, 50, 0.125, 0, 0)
								Citizen.Wait(500)
								ClearPedTasks(playerPed)
								TaskPlayAnimAdvanced(playerPed, "reaction@intimidation@1h", "intro", GetEntityCoords(playerPed, true), 0, 0, rot, 8.0, 3.0, -1, 50, 0.325, 0, 0)
								SetCurrentPedWeapon(playerPed, newWeap, true)
								Citizen.Wait(600)
								ClearPedTasks(playerPed)
								holstered = false
								canFire = true
								currWeapon = newWeap
							end
						end
					else
						if GetPedParachuteState(playerPed) < 1 then 
							if not holstered and CheckWeapon(currWeapon) then
								canFire = false
								TaskPlayAnimAdvanced(playerPed, "reaction@intimidation@1h", "outro", GetEntityCoords(playerPed, true), 0, 0, rot, 8.0, 3.0, -1, 50, 0.125, 0, 0)
								Citizen.Wait(500)
								SetCurrentPedWeapon(playerPed, GetHashKey("WEAPON_UNARMED"), true)
								Citizen.Wait(1500)
								ClearPedTasks(playerPed)
								SetCurrentPedWeapon(playerPed, newWeap, true)
								holstered = true
								canFire = true
								currWeapon = newWeap
							else
								SetCurrentPedWeapon(playerPed, newWeap, true)
								holstered = false
								canFire = true
								currWeapon = newWeap
							end
						end
					end
				end
			end
		end
	end
)
Citizen.CreateThread(
	function()
		while true do
			playerPed = GetPlayerPed(-1)
			Citizen.Wait(1000)
		end
	end
)

Citizen.CreateThread(
	function()
		while true do
			Citizen.Wait(0)
			if not canFire then
				DisableControlAction(0, 25, true)
				DisablePlayerFiring(playerPed, true)
			end
		end
	end
)

function CheckWeapon(newWeap)
	for i = 1, #weapons do
		if GetHashKey(weapons[i]) == newWeap then
			return true
		end
	end
	return false
end

function loadAnimDict(dict)
	while (not HasAnimDictLoaded(dict)) do
		RequestAnimDict(dict)
		Citizen.Wait(5)
	end
end

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.