[HELP] how to disable "handsup" emote while in cars?

Guys please tell if you know how to disable this emote when inside a vechile!?!?!
hands up

find your handsup line and add this check

if IsPedInAnyVehicle(PlayerPedId()) == false then -- give vehicle if is ped in vehicle
      -- add your handsup line 
end
1 Like

it didnt work any way i can add you on discord so you could help me?

You can reach me here on DM, I would appreciate if you share the solution with the forum after you apply it, maybe others will find a solution.

Could you possibly share your handsup code? otherwise simply adding a IsPedInAnyVehicle() check should work just fine for this no?

local animDict = “missminuteman_1ig_2”
local anim = “handsup_enter”
local handsup = false

RegisterKeyMapping(‘ho’, ‘Overgiv dig’, ‘KEYBOARD’, ‘X’)

RegisterCommand(‘ho’, function()
local ped = PlayerPedId()
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Wait(100)
end
handsup = not handsup
if exports[‘qb-policejob’]:IsHandcuffed() then return end
if handsup then
TaskPlayAnim(ped, animDict, anim, 8.0, 8.0, -1, 50, 0, false, false, false)
if IsPedInAnyVehicle(ped, false) then
local vehicle = GetVehiclePedIsIn(ped, false)
if GetPedInVehicleSeat(vehicle, -1) == ped then
CreateThread(function()
while handsup do
Wait(1)
DisableControlAction(0, 59, true) – Disable steering in vehicle
DisableControlAction(0,21,true) – disable sprint
DisableControlAction(0,24,true) – disable attack
DisableControlAction(0,25,true) – disable aim
DisableControlAction(0,47,true) – disable weapon
DisableControlAction(0,58,true) – disable weapon
DisableControlAction(0,71,true) – veh forward
DisableControlAction(0,72,true) – veh backwards
DisableControlAction(0,63,true) – veh turn left
DisableControlAction(0,64,true) – veh turn right
DisableControlAction(0,263,true) – disable melee
DisableControlAction(0,264,true) – disable melee
DisableControlAction(0,257,true) – disable melee
DisableControlAction(0,140,true) – disable melee
DisableControlAction(0,141,true) – disable melee
DisableControlAction(0,142,true) – disable melee
DisableControlAction(0,143,true) – disable melee
DisableControlAction(0,75,true) – disable exit vehicle
DisableControlAction(27,75,true) – disable exit vehicle
end
end)
end
end
else
ClearPedTasks(ped)
end
end, false)

local animDict = “missminuteman_1ig_2”
local anim = “handsup_enter”
local handsup = false

RegisterKeyMapping(‘ho’, ‘Overgiv dig’, ‘KEYBOARD’, ‘X’)

RegisterCommand(‘ho’, function()
local ped = PlayerPedId()
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Wait(100)
end
handsup = not handsup
if exports[‘qb-policejob’]:IsHandcuffed() then return end
if handsup then
if not IsPedInAnyVehicle(ped,false) then
TaskPlayAnim(ped, animDict, anim, 8.0, 8.0, -1, 50, 0, false, false, false)
if IsPedInAnyVehicle(ped, false) then
local vehicle = GetVehiclePedIsIn(ped, false)
if GetPedInVehicleSeat(vehicle, -1) == ped then
CreateThread(function()
while handsup do
Wait(1)
DisableControlAction(0, 59, true) – Disable steering in vehicle
DisableControlAction(0,21,true) – disable sprint
DisableControlAction(0,24,true) – disable attack
DisableControlAction(0,25,true) – disable aim
DisableControlAction(0,47,true) – disable weapon
DisableControlAction(0,58,true) – disable weapon
DisableControlAction(0,71,true) – veh forward
DisableControlAction(0,72,true) – veh backwards
DisableControlAction(0,63,true) – veh turn left
DisableControlAction(0,64,true) – veh turn right
DisableControlAction(0,263,true) – disable melee
DisableControlAction(0,264,true) – disable melee
DisableControlAction(0,257,true) – disable melee
DisableControlAction(0,140,true) – disable melee
DisableControlAction(0,141,true) – disable melee
DisableControlAction(0,142,true) – disable melee
DisableControlAction(0,143,true) – disable melee
DisableControlAction(0,75,true) – disable exit vehicle
DisableControlAction(27,75,true) – disable exit vehicle
end
end)
end
end
end
else
ClearPedTasks(ped)
end
end, false)

should do the trick, if I understood what you were looking for