# Export

**Server Exports Config:**

## AddCoins

```lua
exports['jc_coins']:AddCoins(source, ammount)

-- Example
RegisterCommand("givecoins", function(source, args)
    local targetId = tonumber(args[1])
    local amount = tonumber(args[2])

    if targetId and amount then
        local success = exports['jc_coins']:AddCoins(targetId, amount)

        if success then
            print(("Gave %s coins to player ID %s"):format(amount, targetId))
        else
            print("Could not give coins. Is the player connected?")
        end
    else
        print("Usage: /givecoins [ID] [amount]")
    end
end, true)
```

## RemoveCoins

```lua
exports['jc_coins']:RemoveCoins(source, ammount)

-- Example:
RegisterCommand("removecoins", function(source, args)
    local targetId = tonumber(args[1])
    local amount = tonumber(args[2])

    if targetId and amount then
        local success = exports['jc_coins']:RemoveCoins(targetId, amount)

        if success then
            print(("Removed %s coins from player ID %s"):format(amount, targetId))
        else
            print("Could not remove coins. Is the player connected?")
        end
    else
        print("Usage: /removecoins [ID] [amount]")
    end
end, true)
```

## GetCoins

```lua
exports['jc_coins']:GetCoins(source)

-- Example:
RegisterCommand("viewcoins", function(source, args)
    local targetId = tonumber(args[1]) or source

    local coins = exports['jc_coins']:GetCoins(targetId)

    print(("Player ID %s has %s coins"):format(targetId, coins))
end, true)
```
