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.

Command
Description

/givechips [id] [amount]

Administrative command to give chips, membership required.

/casino

Command for the worker to open the job menu.


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.

GetMemberChips

The GetMemberChips export allows you to retrieve the number of casino chips a player has. This is useful for managing casino economy systems, such as chip stores, rewards, or betting restrictions based on balance.


How to Use

To get a player's chip balance, use the following code:

local chips = exports['qs-diamondcasino']:GetMemberChips(source)
print("The player with ID " .. source .. " has " .. chips .. " chips.")

This export requires the player's ID as an argument and returns the number of chips they have. It is ideal for integration with other casino systems, such as buying or withdrawing chips.

GiveChipsToMember

The GiveChipsToMember export allows you to add a specified amount of casino chips to a player's account. This is useful for administrative actions, rewards, or promotional events within your casino system.


How to Use

To give chips to a player, use the following code:

local chipAmount = 100 -- Replace with the amount of chips to add

exports['qs-diamondcasino']:GiveChipsToMember(source, chipAmount)
print("Added " .. chipAmount .. " chips to player with ID " .. source)

Internally, the export logs the action (e.g., using a Debug function to output details like the identifier and the amount) to help with monitoring and troubleshooting.

RemoveChipsFromMember

The RemoveChipsFromMember export allows you to remove a specified amount of casino chips from a player. This is useful for enforcing betting losses, withdrawals, or other casino-related transactions.


How to Use

To remove chips from a player, use the following code:

local chipAmount = 50 -- Replace with the amount of chips to remove

exports['qs-diamondcasino']:RemoveChipsFromMember(source, chipAmount)
print("Removed " .. chipAmount .. " chips from player with ID " .. source)

This export requires the player's ID and the number of chips to deduct. It automatically processes the transaction and logs the action, making it an efficient way to manage casino chips.

ToggleLockCasino

The ToggleLockCasino export enables or disables the lock state of all casino doors based on the provided boolean value. When called, the function iterates through all the doors defined in Config.CasinoDoors, updating their locked status. It then notifies all clients about the change by triggering the casino:toggleLock event, and logs the action for debugging purposes.


How to Use

To use it, pass a boolean value (true to lock, false to unlock) as shown in the example below:

local lockStatus = true -- Replace with false to unlock the casino doors
exports['qs-diamondcasino']:ToggleLockCasino(lockStatus)
print("Casino doors have been " .. (lockStatus and "locked" or "unlocked") .. ".")

This export is ideal for scenarios where you need to quickly secure or open access to the casino environment, ensuring that all associated doors are updated simultaneously.