I need a script that allows me to bind /me /do on keys on my keyboard…
like I have to press “K” to open my car and I wanna a text like that /me x-y opened his/her car. or something like that I think you know.
I need help with that script: I want to bind the commands on bind like: I don’t have to type /lock I just have to press “K” when I’m close to my car.
Citizen.CreateThread(function()
while true do
Citizen.Wait(100)
if IsControlJustPressed(1, 51) then -- If E is pressed. Can change to K I just don't know which one K is.
-- do something
end
end)
You’d have to factor in distance as well if you want that. Maybe it’s like up to 10-15 feet and then it loses signal. Idk.
Citizen.CreateThread(function()
while true do
Citizen.Wait(100)
if IsControlJustPressed(1, 51) and GetLastInputMethod(2) then -- If E is pressed. Can change to K I just don't know which one K is.
-- do something
end
end)
This will disable the controllers for issues that you may have with controller support if people are using controllers.