Server
Server-sided exports
AddBusiness
Gives a player a business. It skips the reputation and price requirements, but the player still can't own two businesses and the location must be free.
local success, reason = exports["t1ger_moneywash"]:AddBusiness(identifier, businessType, locationId)Parameters
identifier–string– The identifier of the player who receives the business (the framework identifier, for example the ESX identifier or the QBCore citizen ID).businessType–string– The business type, matching a key inshared/locations.lua(for example"coffee_shop").locationId–integer– The ID of the location inshared/locations.lua.
Returns
boolean–trueif the business was given,falseotherwise.string–"success", or the reason it failed:"business_store_not_ready"(the script is still loading),"invalid_player","invalid_type","invalid_location","already_owned"(the location has an owner),"already_owns_business"(the player already has one) or"database_error".
RemoveBusiness
Removes a business permanently and puts its location back on the market. An active stock order for it is cancelled and refunded, and the owner is notified if they are online.
local success, reason = exports["t1ger_moneywash"]:RemoveBusiness(businessType, locationId)Parameters
businessType–string– The business type, for example"coffee_shop".locationId–integer– The ID of the business's location.
Returns
boolean–trueif the business was removed,falseotherwise.string–"success", or the reason it failed:"invalid_type","invalid_location","not_owned"(nobody owns that location),"raid_in_progress","review_in_progress"(the business is busy right now) or"database_error".
IsBusinessInReview
Returns whether a business currently has a books review running, from the first opened desk until the folder is delivered.
Parameters
businessId–integer– The business ID.
Returns
boolean–trueif the business is in a review,falseotherwise.
IsOnContractShift
Returns whether a player is currently on a launder contract shift.
Parameters
source–integer– The player's server ID.
Returns
boolean–trueif the player is on a shift,falseotherwise.
GetPlayerReputation
Returns a player's reputation points and the title of their current level.
Parameters
source–integer– The player's server ID.
Returns
table?– The player's reputation, ornilif it hasn't loaded yet:points–integer– The player's total reputation points.level–string– The title of the player's current level (for example"Registered").
IsReputationReady
Returns whether a player's reputation has finished loading from the database. Check it before you read or change reputation right after a player joins.
Parameters
source–integer– The player's server ID.
Returns
boolean–trueif the reputation is loaded,falseotherwise.
AddReputationPoints
Adds reputation points to a player and updates their screen straight away.
Parameters
source–integer– The player's server ID.amount–number– The points to add.
Returns
boolean–trueif the points were added,falseif the player's reputation isn't loaded oramountisn't a number.
RemoveReputationPoints
Removes reputation points from a player. The total never goes below 0.
Parameters
source–integer– The player's server ID.amount–number– The points to remove.
Returns
boolean–trueif the points were removed,falseif the player's reputation isn't loaded oramountisn't a number.
SetReputationPoints
Sets a player's reputation points directly. The value is rounded down and never goes below 0.
Parameters
source–integer– The player's server ID.amount–number– The new total of points.
Returns
boolean–trueif the points were set,falseif the player's reputation isn't loaded oramountisn't a number.
Last updated