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.
Command
Description
/sendmail [title] [description]
Administrative command to send emails to all players.
/sendbill [id] [price] [reason]
Police command to send a billing to a certain player.
/TogglePhone
Open or close the phone.
/clearalarms
Delete your entire alarm list completely.
/recipe
You can check your type of telephone balance.
/propfix
Remove the prop from your hand.
/resetPhonePos
Reset the position of the phone if you have moved it around your screen.
/deleteUsersPhone
Delete all phone cache data from the entire server.
/deleteUserPhone [id]
Delete all cache data from a specific player's phones.
/setcryptoworth [crypto] [value]
Administrative command that changes the value of the cryptocurrency.
/checkcryptoworth
Check the global price of the cryptocurrency.
/crypto
Check the global price of the cryptocurrency.
/giveinstaverify [username]
Verify a specific Instagram account.
/givetwitterverify [username]
Verify a specific Twitter account.
/deletemarket [id]
Delete or reset a market, useful when making changes to the Markets table.
/chargePhone [id]
Administrative command to recharge the phone of a specific player.
/sos
Send an SOS message to the server's ambulance.
/clearstuckvoice
Command to clear stuck voice.-
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.
InPhone
The InPhone export allows you to check whether the player currently has their phone open. This is particularly useful for preventing conflicts with other menus or actions while the phone is in use.
How to Use
To check if the phone is open, you can use the following code:
local isUsingPhone = exports['qs-smartphone-pro']:InPhone()
if isUsingPhone then
print("The phone is currently open.")
else
print("The phone is not open.")
end
This will return true if the phone is open and false if it is not. You can use this to manage logic for menus or actions that should not overlap with phone usage.
SetCanOpenPhone
The SetCanOpenPhone export allows you to enable or block the use of the phone dynamically. This is particularly useful for controlling phone usage during specific events or scenarios, such as when a player is cuffed or in a restricted area.
This export takes a boolean (true or false) as an argument to enable or disable the phone. Use it in your scripts to manage phone functionality as needed.
ClosePhone
The ClosePhone export allows you to close the phone programmatically. This is useful for scenarios where the phone needs to be closed automatically, such as during specific events or interactions.
How to Use
To close the phone, simply call the following export:
exports['qs-smartphone-pro']:ClosePhone()
No parameters are required for this export. It will instantly close the phone for the player. Use this export to manage phone behavior seamlessly within your scripts.
canUsePhone
The handleClosePhone event allows you to insert custom logic when the phone is closed. This is useful for triggering specific actions or managing states when the phone is closed.
How to Use
To handle the phone close event, use the following code:
AddEventHandler('qs-smartphone-pro:handleClosePhone', function(meta)
-- Add your custom logic here
print("The phone has been closed.")
end)
This event provides flexibility for integrating custom features or behaviors whenever the phone is closed by the player.
IsInCamera
The IsInCamera export allows you to check if the player is currently using the phone's camera. This can be used to manage HUD elements, such as disabling the map when the camera is active.
How to Use
To check if the player is in the camera, use the following code:
local inCamera = exports['qs-smartphone-pro']:IsInCamera()
if inCamera then
-- Disable map rendering or other HUD elements
print("Player is using the camera.")
else
-- Enable map rendering or restore HUD elements
print("Player is not using the camera.")
end
This export returns true if the camera is active and false if it is not. Use it to dynamically adjust gameplay elements based on camera usage.
createCall
The createCall export allows you to start a phone call from your script. This can be used for custom systems like automated dispatch calls, job-based communication, or scripted events.
How to Use
To start a call, use the following code:
-- Example: Create an outgoing call
-- @param name (string): Display name of the contact being called
-- @param number (string): Phone number to dial
-- @param image (string, optional): URL for the contact's avatar/image
-- @param anonymous (boolean, optional): If true, call is anonymous
exports['qs-smartphone-pro']:createCall('Police Department', '911', 'imageLink', true)
This export will initiate a call to the given number. You can pass an image and set it as anonymous if needed. Useful for job roles like EMS or Police.
getCall
The getCall export lets you retrieve information about the current call. It can be used to show call details in custom HUDs or logs.
How to Use
-- Example: Get current call data
-- Returns the current call object (contains type, target info, etc.)
local callData = exports['qs-smartphone-pro']:getCall()
if callData and callData.InCall then
print('[DEBUG] You are in a call with:', callData.TargetData.name)
else
print('[DEBUG] No active call.')
end
This returns a table with current call data, including call type, target contact, and call time. Use it to track or manipulate call states.
endCall
The endCall export allows you to end an active call manually. This is useful for scripted interruptions, admin tools, or timeout features.
How to Use
-- Example: End the current call manually
-- No parameters required
exports['qs-smartphone-pro']:endCall()
print('[DEBUG] Call ended manually.')
No parameters are needed. It immediately stops the current call and resets all related states.
isInCall
The isInCall export checks whether the player is currently in a call. This is useful for conditionally blocking actions or controlling UI.
How to Use
-- Example: Check if player is in an active call
-- Returns true or false
local inCall = exports['qs-smartphone-pro']:isInCall()
if inCall then
print('[DEBUG] You are currently on a call.')
else
print('[DEBUG] No call in progress.')
end
This returns true if the player is in a call, false otherwise. Useful for preventing multiple simultaneous calls or managing interaction logic.
setSOS
The setSOS export allows you to enable or disable the SOS emergency mode of the phone. This is useful for managing situations where you want to control whether players can send emergency calls, such as during events, minigames, or restricted areas.
How to Use
To change the SOS status, you can use the following code:
exports['qs-smartphone-pro']:setSOS(bool) -- true or false
This example disables the SOS system while the player is in a deathmatch.
Example with integration
-- In deathmatch event
TriggerEvent('deathmatch:inDeathmatch', true)
if GetResourceState('qs-smartphone-pro'):find('started') then
exports['qs-smartphone-pro']:setSOS(false)
end
In this case:
The deathmatch event is triggered.
If the qs-smartphone-pro resource is running, the SOS feature is disabled.
Finally, a server event is triggered to set the player requirements.
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.
getPhoneNames
The getPhoneNames export allows you to retrieve a list of all available phone names in the system. This is useful for managing or displaying phone options dynamically.
How to Use
To get a list of phone names, use the following code:
local phoneNames = exports['qs-smartphone-pro']:getPhoneNames()
for _, phone in pairs(phoneNames) do
print("Phone Name: " .. phone)
end
This export returns a table containing all phone names. You can iterate through this table to display or manage the available phones as needed.
GetPhoneNumberFromIdentifier
The GetPhoneNumberFromIdentifier export allows you to retrieve a player's phone number based on their identifier. It prioritizes the phone the player has used most recently, or if unused, retrieves any phone from their inventory.
How to Use
To get a player's phone number, use the following code:
local identifier = "player-identifier" -- Replace with a valid player identifier
local mustBePhoneOwner = true -- Ensures the phone belongs to the identifier (e.g., prevents using stolen phones)
local phoneNumber = exports['qs-smartphone-pro']:GetPhoneNumberFromIdentifier(identifier, mustBePhoneOwner)
if phoneNumber then
print("Player's phone number: " .. phoneNumber)
else
print("No phone number found for this identifier.")
end
Parameters
identifier: The player's unique identifier, such as ESX.GetPlayerFromId(source).identifier.
owner: A boolean (true or false). If true, it ensures the phone number belongs to the identifier (useful for handling stolen phones).
This export is particularly useful for verifying ownership or retrieving contact details dynamically. It returns the phone number as a string or false if no phone number is found.
getMetaFromSource
The getMeta export retrieves the metadata of the phone a player is currently using or the last phone they used. This metadata can include information such as the phone's unique attributes or data associated with it.
How to Use
To retrieve a player's phone metadata, use the following code:
local playerSource = source -- Replace with the player's source ID
local phoneMeta = exports['qs-smartphone-pro']:getMetaFromSource(playerSource)
if phoneMeta then
print("Phone Metadata: " .. json.encode(phoneMeta, { indent = true }))
else
print("No phone metadata found for this player.")
end
Parameter
source: The player's source ID (e.g., the server-side identifier for the player).
This export returns a table containing the phone's metadata or false if no metadata is found. It is particularly useful for debugging, tracking phone usage, or managing custom features related to the phone.
sendSOSMessage
The sendSOSMessage export allows you to send an SOS message to a specified job. This message can include the sender's location or other relevant details, making it ideal for emergency systems.
How to Use
To send an SOS message, use the following code:
local phoneNumber = "123456" -- Replace with the sender's phone number
local job = "ambulance" -- The job to receive the SOS message
local coords = { x = 100.0, y = 200.0, z = 300.0 } -- Coordinates to send
local messageType = "location" -- Use 'location' to send a location-based SOS
exports['qs-smartphone-pro']:sendSOSMessage(phoneNumber, job, json.encode(coords), messageType)
Parameters
phoneNumber: The sender's phone number.
job: The job that will receive the SOS message (e.g., 'ambulance', 'police').
coords: The coordinates to include in the message, encoded as JSON.
type: The type of message. Use 'location' to send a location-based message.
This export is useful for creating emergency features, allowing players to quickly notify specific jobs with critical information. Ensure the phone number and job values are correctly defined for optimal functionality.
sendNewMessageFromApp
The sendNewMessageFromApp export allows you to send a new message from an app to a player's phone. This is commonly used for app-related notifications, such as verification messages or alerts.
How to Use
To send a message from an app, use the following code:
local source = playerSource -- Replace with the player's source ID
local phoneNumber = "123456" -- Phone number of the recipient
local message = "Welcome to our app! Here's your verification code: 12345" -- Message content
local appName = "twitter" -- The name of the app sending the message
exports['qs-smartphone-pro']:sendNewMessageFromApp(source, phoneNumber, message, appName)
Parameters
source: The player's source ID.
phoneNumber: The phone number of the person receiving the message.
message: The content of the message to send.
appName: The name of the app sending the message.
This export is ideal for sending app-generated notifications, such as account verifications or system alerts, directly to a player's phone in a realistic and immersive way.
hasEmailAccount
The hasEmailAccount export checks if a player is logged into the Mail app and returns a boolean value (true or false). This can be used to verify if the player has an active email account in the app.
How to Use
To check if a player is logged into the Mail app, use the following code:
local source = playerSource -- Replace with the player's source ID
local isLoggedIn = exports['qs-smartphone-pro']:hasEmailAccount(source)
if isLoggedIn then
print("Player is logged into the Mail app.")
else
print("Player is not logged into the Mail app.")
end
Parameters
source: The player's source ID.
This export is useful for implementing logic that requires players to be logged into their email account, such as receiving mail or sending messages. It ensures functionality is tied to the player's active email status.