Money

Server functions that are in some way related to the money aspects.

Wosa.Character.Money.RemoveFromAny(
    user, --[[ int ]]
    money --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> money: The amount of money you want to remove.

Description:
This function removes money from the users character from "any avaliable"
payment method. So it will remove from the most suitable payment method such
as pocket cash if the player does not have a card etc.

]]
Wosa.Character.Money.AddToAny(
    user, --[[ int ]]
    money --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> money: The amount of money you want to remove.

Description:
Same as the function above, The only difference is that it adds instead of removes money.

]]
local methods = Wosa.Character.Money.Methods(
    user --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.

Returnal:
-> methods : table
    [1] = RE_VanillaC : bool
    [2] = RE_BusinessC : bool
    [3] = RE_Cash : bool

Description:
Via this function you can get a players avaliable "payment methods".

Example:
local methods = Wosa.Character.Money.Methods(user)

if methods[1] then
    print('the player owns a vanilla credit card')
end

]]
Wosa.Character.Money.Balance(
    user, --[[ int ]]
    method --[[ string ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> method: The "payment method", check the function above for clues.

Description:
Check the money balance for a specific payment method.

Example:
local balance = Wosa.Character.Money.Balance(user, 'RE_Cash')

print('The player has '..balance..' as balance')

]]
Wosa.Character.Money.Add(
    user, --[[ int ]]
    method, --[[ string ]]
    money --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> method: The "payment method".
-> The money you want to add to the payment method.

Description:
Add money to a specific "payment method".

]]
Wosa.Character.Money.Remove(
    user, --[[ int ]]
    method, --[[ string ]]
    money --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> method: The "payment method".
-> The money you want to remove from the payment method.

Description:
Remove money from a specific "payment method".

]]
Wosa.Character.Money.Set(
    user, --[[ int ]]
    method, --[[ string ]]
    money --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> method: The "payment method".
-> The amount of money you want to set it to.

Description:
Instead of adding or removing from a payment method this function "sets" the
money to a specific value, example to 0.

]]

Last updated

Was this helpful?