Skip to main content

Exports and API integration

Server exports

exports["sf-policeradar"]:GiveRadarToVehicle(vehicle)
exports["sf-policeradar"]:RemoveRadarFromVehicle(vehicle)
exports["sf-policeradar"]:GiveScramblerToVehicle(vehicle)
exports["sf-policeradar"]:RemoveScramblerFromVehicle(vehicle)

Parameters:

  • vehicle: Entity - Vehicle entity

Client exports

exports["sf-policeradar"]:SetBoloPlate(plate, isBolo)
-- { [plate] = isBolo }
exports["sf-policeradar"]:SetAllBoloPlates(plates)

Client API (editable_api.lua)

You can implement your own plate lookup logic here.

danger

Please be mindful of the frequency at which these functions are called - up to three times a second! To ensure optimal server performance and prevent unnecessary strain on your database or external API, it is crucial to avoid making excessive callbacks. We highly recommend refraining from any server callbacks that involve lookups on your database or external API. Unnecessary callbacks can lead to significant performance issues and potential disruptions in your server's operation. If you are uncertain about handling these callbacks properly, it is best to avoid implementing them altogether

function OnPlateChange(plate, isFront)
if(plate ~= lastPlate) then
return boloPlates[tostring(plate)]
end
return false
end

function OnPlateLock(plate, isFront)
if(plate ~= lastPlate) then
return boloPlates[tostring(plate)]
end
return false
end