Exports
getVip(playerId)
Retrieve the VIP status from the player.
parameters:
playerId
number
: The player server ID.
returns:
status
boolean
local isVIP = exports['av_vip']:isVIP(playerId)
print(isVIP) -- true/false
addVIP(playerId, months)
Extends or grants a VIP membership to a player for the specified months.
parameters:
playerId
number
: The player server ID.months
number
: Duration or extension of the VIP membership
exports['av_vip']:addVIP(playerId, 6)
getTokens(playerId)
Get the tokens owned by the player using his server ID.
parameters:
playerId
number
: Player server ID.
returns:
amount
number
local tokens = exports['av_vip']:getTokens(playerId)
print(tokens) -- number (0 - ????)
addTokens(playerId, amount)
Add tokens to the player.
parameters:
playerId
number
: The player server ID.amount
number
: The amount to add.
returns:
tokens
number
: Returns the current amount of tokens.
local newAmount = exports['av_vip']:addTokens(playerId, 500)
print(newAmount)
removeTokens(playerId, amount)
Remove tokens from the player.
Make sure to always run a getTokens() before, this export does NOT verify the current amount of tokens owned by the player.
parameters:
playerId
number
: The player server ID.amount
number
: Amount of tokens to remove.
local toRemove = 50
local myTokens = exports['av_vip']:getTokens(playerId)
if myTokens and tonumber(myTokens) >= toRemove then
exports['av_vip']:removeTokens(playerId, toRemove)
else
print("Player doesn't have enough tokens")
end
Last updated