For some reason whenever I rejoin the server the Registered Key Mappings won’t work.
RegisterKeyMapping('+handsup', 'Handen omhoog!', 'keyboard', 'x')
RegisterKeyMapping('+crossarms', 'Armen over elkaar', 'keyboard', 'g')
RegisterKeyMapping('+crouch', 'Bukken', 'keyboard', 'lcontrol')
After you rejoin the server it shows the keymappings inside FiveM, but it actually doesn’t do anything.
RegisterCommand('+handsup', function()
if not IsPedInAnyVehicle(lPed, false) and not IsPedSwimming(lPed) and not IsPedShooting(lPed) and not IsPedClimbing(lPed) and not IsPedCuffed(lPed) and not IsPedDiving(lPed) and not IsPedFalling(lPed) and not IsPedJumping(lPed) and not IsPedJumpingOutOfVehicle(lPed) and IsPedOnFoot(lPed) and not IsPedRunning(lPed) and not IsPedUsingAnyScenario(lPed) and not IsPedInParachuteFreeFall(lPed) then
handsup = true
EmoteCancel()
EmoteCommandStart(nil, {'handsup', 'handsup'})
end
end, false)
RegisterCommand('-handsup', function()
EmoteCancel()
handsup = false
end, false)
Above here you see the registering of the command.