Exports and Statebags
Public API contracts (exports/statebags) for gcm_vipsystem.
This section intentionally tracks only exports and statebags.
Client Exports
getVip()
- Context: client export
- Signature:
lua
local vipType = exports['gcm_vips']:getVip()
- Returns:
- VIP key string (for example
vip_oro) when active falsewhen player has no active VIP
- VIP key string (for example
Usage example
lua
local vipType = exports['gcm_vips']:getVip()
if vipType then
print(('Player VIP is %s'):format(vipType))
end
Server Exports
getVip(src)
- Context: server export
- Signature:
lua
local vipType = exports['gcm_vips']:getVip(source)
- Returns:
- VIP key string if active
falseotherwise
Usage example
lua
local vipType = exports['gcm_vips']:getVip(source)
if vipType == 'vip_diamante' then
-- apply premium server-side logic
end
giveVipUser(src, vip_type, days)
- Context: server export
- Signature:
lua
local ok = exports['gcm_vips']:giveVipUser(src, vipType, days)
-
Parameters:
src(number): target player sourcevipType(string): key inConfig.Vipsdays(number): duration in days (0means lifetime)
-
Returns:
trueon inserted/extended VIPfalseon failure or incompatible active VIP state
Usage example
lua
local ok = exports['gcm_vips']:giveVipUser(source, 'vip_oro', 30)
if not ok then
print('VIP grant failed')
end
getDaysRemaining(src)
- Context: server export
- Signature:
lua
local remaining = exports['gcm_vips']:getDaysRemaining(src)
- Returns:
number(days remaining)'lifetime'falsewhen no active VIP
Usage example
lua
local remaining = exports['gcm_vips']:getDaysRemaining(source)
if remaining == 'lifetime' then
print('Permanent VIP')
elseif type(remaining) == 'number' then
print(('VIP expires in %s days'):format(remaining))
end
Statebags
Statebag keys
At the moment, there are no documented statebag keys in gcm_vips.
If statebag keys are added in future updates, they will appear here with ownership notes and read/write examples.