Skip to main content

giveCoins

exports["RiP-Coins"]:giveCoins(playerId, amount) 

This function gives a specified amount of coins to a player

Arguments

NameTypeOptionalExplenation
playerIdIntegerNoPlayer server-id
amountIntegerNoAmount 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