Cadburry ScriptsCadburry Scripts

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.

lua
exports['cad-queue']:GetUserRoles(discordid)

Returns:

  • table – List of role IDs assigned to the user, or nil if not found.

Usage:

lua
local roles = exports['cad-queue']:GetUserRoles("discord:123456789012345678")
if roles then
    print("User roles:", json.encode(roles))
end

AddRoleToUser

Assigns a specific Discord role to the user.

lua
exports['cad-queue']:AddRoleToUser(discordid, roleid)

Parameters:

  • discordid – The Discord identifier (e.g., discord:123456789012345678)

  • roleid – The role ID to assign

Returns:

  • boolean – true if the role was added successfully, false otherwise.


RemoveRoleFromUser

Removes a specific Discord role from the user.

lua
exports['cad-queue']:RemoveRoleFromUser(discordid, roleid)

Parameters:

  • discordid – The Discord identifier (e.g., discord:123456789012345678)

  • roleid – The role ID to remove

Returns:

  • boolean – true if the role was removed successfully, false otherwise.


GetPrio

Returns the priority data for a given identifier.

lua
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.

lua
exports['cad-queue']:GetQueuePos(identifier)

Parameters:

  • identifier – Unique player identifier

Returns:

  • number – Queue position or nil if not in queue.


SetQueuePos

Moves a player to a new position in the queue.

lua
exports['cad-queue']:SetQueuePos(identifier, newPos)

Parameters:

  • identifier – Unique player identifier

  • newPos – Desired new queue position

Returns:

  • boolean – true if successful, false if invalid position or player not found.


GetQueueCount

Returns the total number of players currently in the queue.

lua
exports['cad-queue']:GetQueueCount()

Returns:

  • number – Number of players in the queue.

Last updated Cadburry Scripts