Developers
Player access from your resource
Read a player's CAD access from your own FiveM resource - callsign, patrol, dispatch, supervisor, civilian and departments.
Read what a paired player can do in the CAD from your own resource on the same server: their callsign, whether they have patrol, dispatch or supervisor access, and their departments. Use it to open anything in game by CAD access - an armory, vehicle spawns, job menus, uniforms.
Setup
Have the server owner name your resource in PlateNet's server/security.lua, then restart platenet:
PlateNetSecurity = {
PlayerAccess = {
['your_resource'] = true,
},
}
The key is the resource folder name, exactly. Needs PlateNet resource 1.10.0 or newer.
GetPlayerAccess
exports.platenet:GetPlayerAccess(src, function(result)
if result.success and result.unit then
OpenPatrolMenu(src)
end
end)
src- number, required. Server id of the player. They need a paired tablet.
Call it when you need the answer, such as when a menu opens.
Response:
{
"success": true,
"callsign": "1-ADAM-12",
"unit": true,
"dispatch": false,
"supervisor": false,
"civilian": false,
"departments": [
{ "code": "LSPD", "service_type": "POLICE", "primary": true }
]
}
| Field | Means |
|---|---|
callsign | The player's callsign in this community |
unit | Patrol CAD access |
dispatch | Dispatch access |
supervisor | Supervisor, or manages the community |
civilian | None of patrol, dispatch or supervisor |
departments | Every department they belong to. service_type is POLICE, SHERIFF, STATE, FIRE_EMS, JUDICIAL or OTHER. primary marks their main one. |
departments can be empty. Read it as a list whether it arrives as a list or an object.
Errors
result.error is one of these:
Access denied.- Ask the server owner to add your resource underPlayerAccessinserver/security.luaand restart PlateNet.Invalid player.- Pass the server id of a connected player, as a number.Player is not paired.- Also setsunpaired = true. Send the player to pair a tablet.Rate limit reached.- Wait a minute, then call again.PlateNet request failed.- Try again later.
Back to the PlateNet documentation index / All Developers pages