Skip to main content

removeCoins

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

This function removes a specified amount of coins from a player

Arguments

NameTypeOptionalExplenation
playerIdInteger/StringNoPlayer server-id
amountIntegerNoAmount 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