removeCoins
exports["RiP-Coins"]:removeCoins(playerId, amount)
This function removes a specified amount of coins from a player
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
playerId | Integer/String | No | Player server-id |
amount | Integer | No | Amount of coins to remove |
Returned Boolean
If the action was successful it returns true
. Otherwise it will return false
with possibly an error in the server console.
Example
local xPlayer = ESX.GetPlayerFromId(source)
local state = exports["RiP-Coins"]:removeCoins(xPlayer.source, 1000)
if state then
print("1000 coins where removed from player "..xPlayer.source)
else
print("Error occurred")
end