Exports and Commands
Parameters:
source
(number): Player's server IDaddictionType
(string): Type of addiction (must exist in config)points
(number): Amount of addiction points to add
Returns: boolean
- Success status
Example:
RemoveAddiction
RemoveAddiction
Purpose: Remove addiction points from a player.
Usage:
Parameters:
source
(number): Player's server IDaddictionType
(string): Type of addictionpoints
(number): Amount of points to remove (-1 to remove all)
Returns: boolean
- Success status
Example:
CureAddiction
CureAddiction
Purpose: Completely cure a specific addiction (convenience function).
Usage:
Parameters:
source
(number): Player's server IDaddictionType
(string): Type of addiction to cure
Returns: boolean
- Success status
Example:
GiveMaxAddiction
GiveMaxAddiction
Purpose: Give maximum addiction level to a player.
Usage:
Parameters:
source
(number): Player's server IDaddictionType
(string): Type of addiction
Returns: boolean
- Success status
Example:
UsedItem
UsedItem
Purpose: Trigger addiction effects when a player uses an item. - NOTE: IF YOU ARE USING OX_INVENTORY - YOU DO NOT NEED THIS!
Usage:
Parameters:
source
(number): Player's server IDitemName
(string): Name of the item used
Returns: void
Example:
๐ป Client-Side Exports
AddAddiction
AddAddiction
Purpose: Add addiction points from client-side scripts.
Usage:
Parameters:
addictionType
(string): Type of addictionpoints
(number): Amount of addiction points to add
Returns: boolean
- Success status
Example:
RemoveAddiction
RemoveAddiction
Purpose: Remove addiction points from client-side scripts.
Usage:
Parameters:
addictionType
(string): Type of addictionpoints
(number): Amount of points to remove (-1 to remove all)
Returns: boolean
- Success status
Example:
CureAddiction
CureAddiction
Purpose: Completely cure a specific addiction from client.
Usage:
Parameters:
addictionType
(string): Type of addiction to cure
Returns: boolean
- Success status
Example:
GiveMaxAddiction
GiveMaxAddiction
Purpose: Give maximum addiction level from client.
Usage:
Parameters:
addictionType
(string): Type of addiction
Returns: boolean
- Success status
Example:
UpdatePlayerBlemishes
UpdatePlayerBlemishes
Purpose: Update player's visual effects based on current addictions.
Usage:
Parameters: None
Returns: void
Example:
ClearAllVisualEffects
ClearAllVisualEffects
Purpose: Clear all addiction-related visual effects.
Usage:
Parameters: None
Returns: void
Example:
๐งช Test Mode Settings
Config.SelfTestMode - Allows you to run Blood Tests / Stomach Pumping / Commit To Rehab on yourself for testing purposes
Config.TestCommands
Note: These commands are only available when Config.TestCommands = true
Server Test Mode Commands
/testaddiction
Test addiction level calculations.
/giveaddiction
Give addiction points to yourself.
/giveAllAddictions
Give all available addictions to yourself.
Client Test Mode Commands
/addcraving
Add craving points to a specific addiction.
/takeBloodFromSelf
(when Config.SelfTestMode is true and on Authorised Job)
Take a blood sample from yourself.
/addAddiction
Test the AddAddiction export function.
/removeAddiction
Test the RemoveAddiction export function.
/cureAddiction
Test the CureAddiction export function.
/maxAddiction
Test the GiveMaxAddiction export function.
/updateBlemishes
Test the blemish system and update visual effects.
/clearBlemishes
Clear all visual effects manually.
/toggleFocus
Toggle NUI focus (bound to Left Alt by default).
Yoga Commands (if enabled in config)
Start yoga activity for time reduction in rehab.
๐ Usage Examples
Adding Gambling Addiction After Casino Activity
Drug Taking Consequences
Medical Treatment Script
Client-side Integration
Last updated