How to disable " like press K or F2 " when people in car?

guys. i dont want to people press F1 or some other key like F3 or K "its depends. "
i mean how to disable press key when people in car ?
Thank you.

1 Like
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0) -- Wait 0 seconds to prevent crashing.
        if IsPedInAnyVehicle(PlayerPedId(), true) then -- If the player is (trying to use /) using a vehicle
            DisableControlAction(0, --[[Control ID Goes Here]], true)
        end
    end
end)


https://wiki.fivem.net/wiki/Controls

2 Likes

@Vespura
How about press key automaticly when player in a car ?
Just one time when he enter the car ?

Not sure that’s possible.

@Vespura

how about make this disable when people in vehicle

local function ch_emote(player,choice)
  local emote = emotes[choice]
  if emote then
     vRPclient.playAnim(player,{emote[1],emote[2],emote[3]})
  end
end