Commands & 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.
/police [message]
Sends a dispatch call to the police (similar to /enterno)
/ambulance [message]
Same thing but for medics.
/mechanic [message]
Same thing but for mechanics.
/panic [message]
Panic call sent by a police officer to all other police officers.
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.
GetPlayerInfo
The GetPlayerInfo export retrieves detailed information about the player. This can be used for various server-side or client-side implementations where player data is needed.
How to Use
To get the player's information, use the following code:
local playerInfo = exports['qs-dispatch']:GetPlayerInfo()
if playerInfo then
print("Player coordinates: " .. tostring(playerInfo.coords))
print("Nearby street: " .. playerInfo.street_1)
print("Player vehicle: " .. (playerInfo.vehicle_label or "None"))
else
print("Failed to retrieve player info.")
endReturn Data
The export returns an object containing the following details:
ped: The player's character identifier.coords: Player's current map coordinates.street_1: Name of the closest street.street_2: Name of the second nearest street (if applicable).sex: Player character's gender.vehicle: Vehicle identifier if the player is inside a vehicle.vehicle_label: The vehicle's label or description.vehicle_colour: The vehicle's color.vehicle_plate: The vehicle's registration plate.speed: Current speed of the vehicle in km/h (if applicable).
Example Output
Use this export to dynamically retrieve and use player-related data in your scripts.
{
ped = 123,
coords = vector3(200.12, -150.34, 50.08),
street_1 = "Great Ocean Hwy",
street_2 = "Joshua Rd",
sex = "Male",
vehicle = "vehicle_01",
vehicle_label = "Sultan RS",
vehicle_colour = "Red",
vehicle_plate = "AB123CD",
speed = 120
}getSSURL
The getSSURL export allows you to retrieve a screenshot of the local player (client) dynamically. This can be useful for creating visual evidence, sending images to a server, or for custom gameplay features.
How to Use
To get the screenshot URL, use the following code:
exports['qs-dispatch']:getSSURL(function(image)
print("Screenshot URL: " .. (image or "No image available"))
end)This export runs asynchronously and returns a string containing the image URL, such as cdn.discordapp.net/image.png. If the screenshot cannot be taken, the image variable will return nil. You can use this export to integrate screenshots into your scripts dynamically.
ToggleDuty
The job duty system allows you to manage whether a player has access to the dispatch and MDT systems. This is particularly useful for controlling access based on duty status, ensuring only active personnel can use these features.
How to Use
To toggle a player's duty status, use the following export:
To check a player's current duty status, use:
These exports help manage permissions dynamically, ensuring that dispatch and MDT functionalities are only available to those on active duty.
Default Exports
The Quasar Dispatch asset provides a variety of exports to trigger predefined dispatch calls for specific scenarios. These exports allow you to integrate key events into your server, enhancing roleplay and emergency response dynamics. Below is a comprehensive list of default exports included in the asset:
Commonly Used Exports:
VehicleShooting: Trigger a dispatch for shooting from a vehicle.
Shooting: Notify law enforcement of a reported shooting.
OfficerDown: Alert for an officer in distress or injured.
Robbery-Related Exports:
StoreRobbery: Trigger dispatch for store robberies.
FleecaBankRobbery, PaletoBankRobbery, PacificBankRobbery: Specific bank robbery dispatches.
VangelicoRobbery: Dispatch for jewelry store robberies.
HouseRobbery: Notify law enforcement of residential burglaries.
ArtGalleryRobbery, HumaneRobbery, TrainRobbery, VanRobbery, UndergroundRobbery, DrugBoatRobbery, UnionRobbery, YachtHeist: Specialized heist and robbery alerts.
Crime & Suspicious Activity:
DrugSale: Dispatch for illegal drug sales.
SuspiciousActivity: Report of unusual or potentially illegal actions.
CarJacking, VehicleTheft, CarBoosting: Vehicle-related crimes.
IllegalRacing: Notify of street racing activity.
Kidnapping: Dispatch for reported abductions.
Miscellaneous Exports:
PrisonBreak: Alert for a prison escape.
IllegalFishing: Notify law enforcement of unlawful fishing activities.
ArmsDeal: Dispatch for illegal weapons trading.
CyberAttack: Alerts for a reported cybercrime or hack.
How to Use
To trigger any of these events, use the export in your code like this:
Replace Shooting() with the desired export to trigger a specific event. These exports allow seamless integration of dynamic scenarios into your server for better roleplay and gameplay experiences.
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.
GetPlayerInfo
The GetPlayerInfo export allows you to retrieve detailed information about a specific player by their player ID. This is particularly useful for server-side operations that require dynamic access to player data.
How to Use
To get a player's information, pass their player ID and a callback function to the export:
Return Data
The export returns a structured object containing the following player details:
ped: Player's character identifier.
coords: Current map coordinates of the player.
street_1: Name of the nearest street.
street_2: Name of the second nearest street (if applicable).
sex: Player character's gender.
vehicle: Identifier of the vehicle the player is in (if any).
vehicle_label: Vehicle's label or description.
vehicle_colour: Color of the player's vehicle.
vehicle_plate: Vehicle's registration plate.
speed: Current speed of the vehicle in km/h (if applicable).
Example Output
Here’s an example of the returned data structure:
Use this export to integrate real-time player data into your scripts efficiently.
GetSSURL
The GetSSURL export allows you to capture a screenshot of a specific player. This screenshot can be used in dispatch systems or other features where visual context is required.
How to Use
To use this export, pass the player's ID and a callback function to process the result:
The export returns:
A URL string pointing to the screenshot (e.g.,
cdn.discordapp.net/image.png).nilif the screenshot cannot be captured.
Use this export to enhance dispatch systems or other gameplay elements by providing visual evidence tied to player activities.