Skip to main content

getCoins

exports["RiP-Coins"]:getCoins(playerId) 

This function returns the number of coins of a player

Arguments

NameTypeOptionalExplenation
playerIdIntegerNoPlayer 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