Exports
Quality of life scripts for your FiveM server. Performance optimized resources that install in minutes, with free updates and support that actually answers.
GetUserRoles
Fetches the Discord roles of a user based on their Discord identifier.
exports['cad-queue']:GetUserRoles(discordid)Returns:
tableβ List of role IDs assigned to the user, ornilif not found.
Usage:
local roles = exports['cad-queue']:GetUserRoles("discord:123456789012345678")
if roles then
print("User roles:", json.encode(roles))
endAddRoleToUser
Assigns a specific Discord role to the user.
exports['cad-queue']:AddRoleToUser(discordid, roleid)Parameters:
discordidβ The Discord identifier (e.g.,discord:123456789012345678)roleidβ The role ID to assign
Returns:
booleanβtrueif the role was added successfully,falseotherwise.
RemoveRoleFromUser
Removes a specific Discord role from the user.
exports['cad-queue']:RemoveRoleFromUser(discordid, roleid)Parameters:
discordidβ The Discord identifier (e.g.,discord:123456789012345678)roleidβ The role ID to remove
Returns:
booleanβtrueif the role was removed successfully,falseotherwise.
GetPrio
Returns the priority data for a given identifier.
exports['cad-queue']:GetPrio(identifier)Parameters:
identifierβ Unique player identifier
Returns:
anyβ Priority value associated with the identifier.
GetQueuePos
Gets the queue position of a player using their identifier.
exports['cad-queue']:GetQueuePos(identifier)Parameters:
identifierβ Unique player identifier
Returns:
numberβ Queue position ornilif not in queue.
SetQueuePos
Moves a player to a new position in the queue.
exports['cad-queue']:SetQueuePos(identifier, newPos)Parameters:
identifierβ Unique player identifiernewPosβ Desired new queue position
Returns:
booleanβtrueif successful,falseif invalid position or player not found.
GetQueueCount
Returns the total number of players currently in the queue.
exports['cad-queue']:GetQueueCount()Returns:
numberβ Number of players in the queue.
