addCommandHandler("lock",
function()
local car = getPedOccupiedVehicle(localPlayer)
if not isPedInVehicle(localPlayer) then outputChatBox("You may only use this command while in a vehicle!", 250, 0, 0) return end
if not isVehicleLocked(car) then
setVehicleLocked(car, true)
lockstatus = "Locked"
outputChatBox(lockstatus)
playSound("carAlarmArming.mp3", false)
else
setVehicleLocked(car, false)
lockstatus = "Un Locked"
outputChatBox(lockstatus)
playSound("carAlarmArming.mp3", false)
end
end)