Any idea how I can make it so that only people with the police job can go in emergency vehicles?
My current code:
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local ped = GetPlayerPed(-1)
if PlayerData.job ~= nil and PlayerData.job.name == ‘police’ then
if IsPedInAnyVehicle(ped) then
if GetVehicleClass( GetVehiclePedIsIn(ped, false ) ) == 18 then
SetVehicleUndriveable(GetVehiclePedIsUsing(ped), true)
end
end
end
end
end)