getCoins
exports["RiP-Coins"]:getCoins(playerId)
This function returns the number of coins of a player
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
playerId | Integer | No | Player server-id |
Returned Integer
If the action was successful it returns the amount of coins as an integer. Otherwise it will return false
with possibly an error in the server console.
Example
local xPlayer = ESX.GetPlayerFromId(source)
local xCoins = exports["RiP-Coins"]:getGoins(xPlayer.source)
if xCoins ~= false then
print("player "..xPlayer.source.. "has "..xCoins.." RiP-Coins")
else
print("Error occurred")
end