How to Use
Operational usage examples and integration patterns for gcm_vipsystem.
On this page, we explain how to use the resource.
Default commands
/vipmenu: Open VIP menu (configurable inConfig.lua)./code: Redeem a code (configurable inConfig.lua).
Deployment to other resources
lua
local vip = exports['gcm_vips']:getVip()
print(vip)
-- Returns false if user has no active VIP.
-- Returns VIP name if active (e.g. vip_diamond).
Server-side:
lua
local vip = exports['gcm_vips']:getVip(source)
print(vip)
-- Same behavior as client, but requires player source.
Export to give VIP status
lua
-- If you need lifetime VIP, pass days as 0
exports['gcm_vips']:giveVipUser(src, vip_type, days)
lua
if exports['gcm_vips']:giveVipUser(src, vip_type, days) then
-- VIP delivered or updated successfully
else
-- User has another active VIP and delivery was not applied
end
Export to get days remaining
lua
local days = exports['gcm_vips']:getDaysRemaining(src)
Returns remaining days, 'lifetime' for permanent VIP, or false if no VIP.