Quasar Store Logo

Commands and Exports

This section lists all available commands, exports, and events included in the script. You’ll find client-side, server-side, and shared functions designed to help developers integrate, extend, or interact with the system easily within their own scripts or frameworks.

Commands

This section lists all available commands included in the script. Each command is designed to simplify administration, player interaction, or debugging tasks. You’ll find detailed descriptions, usage examples, and permission requirements to help you manage and customize your server efficiently.

CommandDescription
/cadOpen the police CAD (dispatch, search, radio, management)
/policeadminOpen the police admin interface (settings, markers, permissions)
/rpol [message]Use /rpol <message> in chat.





Client Exports

This section provides all available client exports for the script. These functions allow you to interact directly with the system from the client side, enabling custom features, UI interactions, and integrations with other resources. Each export includes a short description and usage example for easy implementation.

CreateDispatchCall

GetScreenshotUrl

GetPlayerInfo

SetDutyStatus





Server Exports

This section provides all available server exports for the script. These functions allow developers to interact with the system from the server side, manage data, trigger actions, and integrate with other resources. Each export includes a clear description and a practical example to simplify its implementation.

CreateDispatchCall

GetScreenshotUrl

GetPlayerInfo

GetPlayerInfo (Server-Side) lets you retrieve detailed player, vehicle, and location data directly from the server using a player’s source. It’s useful for building dispatches, logs, and any system that needs player context without relying on client logic.



Basic Usage

Gets player info safely and prints coordinates.

local info = GetPlayerInfo(source) if not info then print('GetPlayerInfo failed:', source) return end print('Coords:', info.coords)



Street Formatting

Builds a proper street name including intersections.

local info = GetPlayerInfo(source) or {} local street = info.street_1 or 'Unknown' if info.street_2 and info.street_2 ~= '' then street = street .. ' / ' .. info.street_2 end



Vehicle Detection

Checks if the player is in a vehicle and prints details.

local info = GetPlayerInfo(source) or {} if info.vehicle then print(info.vehicle_label, info.vehicle_plate, info.speed) else print('Player on foot') end



Build Summary

Creates a simple readable summary for logs or dispatch.

local info = GetPlayerInfo(source) or {} local summary = 'On foot' if info.vehicle_label then summary = ('In %s [%s] at %d km/h'):format( info.vehicle_label, info.vehicle_plate or '???', info.speed or 0 ) end



Full Safe Pattern (Recommended)

Handles all edge cases and builds a complete description.

local info = GetPlayerInfo(source) local coords = info and info.coords or GetEntityCoords(GetPlayerPed(source)) local street = info and info.street_1 or 'Unknown' local vehicleText = '' if info and info.vehicle_label then vehicleText = (' Vehicle: %s [%s] (%d km/h)'):format( info.vehicle_label, info.vehicle_plate or '???', info.speed or 0 ) end local desc = ('Incident at %s.%s'):format(street, vehicleText)



This function is server-side and depends on the player being connected, so you should always validate the source before using it. You should never assume it returns data, and always check fields like vehicle before accessing them to avoid errors. It’s designed to simplify your code by replacing multiple native calls, and works especially well for dispatch systems, logs, and automated detections where you need clean and reliable player context.