functions.lua
đź› Debugging & Utility Functions
Debug Print
Description: Prints a debug message if debugging is enabled.
Arguments:
file
(string) – The file name where the debug was triggered.msg
(string) – The message to display.
Get Vehicle Image
Description: Retrieves a vehicle image URL based on the model. To get more info about vehicle images check out this
Arguments:
model
(string) – The spawn code of the vehicle.
Returns: (string) The URL to the vehicle’s image.
Is Admin
Description: Checks if a player has admin permissions.
Arguments:
source
(number) – The player’s source ID.
Returns: (boolean)
true
if the player is an admin, otherwisefalse
.
Server Notify
Description: Sends a server notification to a player.
Arguments:
source
(number) – The target player.msg
(string) – The notification message.type
(string, optional) – Notification type (default:info
).time
(number, optional) – Duration in milliseconds (default: 5000ms).title
(string, optional) – Notification title.
đźš— Garage & Vehicle Handling
Get Society Garage
Description: Determines the default garage for a given job.
Arguments:
job
(string) – The job name.
Returns: (string) The name of the society garage.
Get Impound By Type
Description: Determines the appropriate impound lot for a given vehicle type.
Arguments:
vehicleType
(string) – The type of vehicle.
Returns: (string) The impound lot name.
Delivery Check
Description: Checks if a vehicle contains illegal items before delivery.
Arguments:
source
(number) – The player’s source ID.plate
(string) – The vehicle plate.deliveryTime
(number) – Delivery time in milliseconds.entity
(entity ID, optional) – The vehicle entity.
Returns: (boolean)
true
if delivery is allowed, otherwisefalse
.
Took Vehicle Out
Description: Handles vehicle retrieval (for societies and personal vehicles).
Arguments:
source
(number) – The player’s source ID.plate
(string) – The vehicle plate.vehType
(string) – The vehicle type.model
(string) – The vehicle model.vehicleProps
(table) – The vehicle’s properties.owner
(string) – Values: personal or society.impound
(boolean) – Whether the vehicle was impounded.
Returns: None.
Parked Vehicle
Description: Handles vehicle parking.
Arguments:
source
(number) – The player’s source ID.plate
(string) – The vehicle plate.vehType
(string) – The vehicle type.model
(string) – The vehicle model.vehicleProps
(table) – The vehicle’s properties.owner
(string) – The vehicle owner.
Returns: None.
On Plate Change
Description: Updates the vehicle’s plate in the database.
Arguments:
identifier
(string) – The owner’s identifier.oldPlate
(string) – The old plate number.newPlate
(string) – The new plate number.
Returns: None.
👨‍💼 Permissions & Command Access
Is Boss
Description: Checks if a player is a boss in their job.
Arguments:
source
(number) – The player’s source ID.
Returns: (boolean)
true
if the player is a boss, otherwisefalse
.
Can Transfer Vehicle
Description: Determines if a vehicle can be transferred.
Arguments:
source
(number) – The player’s source ID.targetId
(number) – The target player’s source ID.ownerIdentifier
(string) – The current owner’s identifier.targetIdentifier
(string) – The new owner’s identifier.plate
(string) – The vehicle plate.name
(string) – The vehicle’s name.price
(number) – The sale price.
Returns: (boolean)
true
if transfer is allowed.
Can Run Command
Description: Checks if a player can run a specific command.
Arguments:
source
(number) – The player’s source ID.accessingCommand
(string) – The command type (vehicleMenu
,giveKeys
,deleteKeys
,vehicleAdd
,vehicleRemove
).
Returns: (boolean)
true
if the command can be executed.
Last updated