Keymapping

If you want to use the RegisterKeyMapping function instead of the IsControlJustPressed way you can achieve this quite easy:

In the client/custom.lua comment the lines 85 to 92 out and comment the lines 94 to 102 in. It should look like the followiing codeblock:

```lua

RegisterCommand('carlock', function()
	startlocking()
end)

RegisterKeyMapping('carlock', _U("keymapping"), 'keyboard', 'i') -- Dont forget to change your Key here



-- THE OLD WAY TO USE:
--[[
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if (IsControlJustPressed(1, Config.Key)) then
            startlocking()
        end
    end
end)
]]
```

DO NOT FORGET TO CHANGE YOUR KEY TO SOMETHING YOU PREFER INSTEAD OF i IN LINE 90!

Last updated