Well, this could be used for when you're in a friends car or something and they are AFK, idk. Maybe for higher staff that can spawn cars. Anyways, I put it below. I know you could just cancelEvent for a player entering a vehicle that has a staff in it, but then no player could enter the vehicle you're in even if you wanted them too.
Pointless, yes, but who cares lol.
Don't hate on my indentation/spacing Arran <_<
I did it to solve any time wasting in typing it out for you. Code seems fine, can just add it
function lockCar(player, command)
if (getTeamName(getPlayerTeam(player)) ~= "Staff") then return end
local veh = getPedOccupiedVehicle(player)
if veh then setVehicleLocked(veh, true)
outputChatBox("Your staff has locked the "..getVehicleName(veh)..".",player,0,255,0)
end
end
addCommandHandler("lc", lockCar)