I have played in a few different servers that have a script running that blocks unauthorized users from driving emergency vehicles. It allows them to get into the vehicle but then a prompt states that they are not authorized to access this vehicle.
does anyone know where i could find a script that offers this feature? I have look on the forums and performed a google search, i apologize if i overlooked it.
Just create a thread that gets the job from the player and get if it his on a vehicle and if it is a emergency model, then make the vehicle undrivable… This is easy to do
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local ped = GetPlayerPed(-1)
if job ~= 'police' then
if IsPedInAnyVehicle(ped) then
if GetVehicleClass( GetVehiclePedIsIn(ped, false ) ) == 18 then
SetVehicleUndriveable(GetVehiclePedIsUsing(ped), true)
end
end
end
end
end)
I dont now how you get your jobs, if you use esx, or vrp or even stand alone, so replace this:
thank you very much for your help! i have limited experience with coding and most of what i have done has been picking bits and pieces of multiple scripts to build what i want, i just couldnt figure this out
so i dont us ESX or vRP, so i want to make it so i can create a job, like police menu, where they can get whitelisted then drive the menu. so essentially i there is a place near every hospital or fire station where the whitelisted EMS can click e and then select EMT or EMS and they can drive their respective vehicles, i know the Cops-FiveM script doesnt do this but i would love for it, or i make it so people not in cop peds cant drive the cop cars
in my case, i want only police officers/EMS to be able to drive their respective vehicles, whether my PED is in uniform or undercover in an unmarked vehicle