giveCoins
exports["RiP-Coins"]:giveCoins(playerId, amount)
This function gives a specified amount of coins to a player
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
playerId | Integer | No | Player server-id |
amount | Integer | No | Amount of coins to add |
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"]:giveCoins(xPlayer.source, 1000)
if state then
print("1000 coins where added to player "..xPlayer.source)
else
print("Error occurred")
end