Options for Exports and their usage on the Server Side
ATTENTION
DO NOT CHANGE THE RESOURCE NAME OR EXPORTS WILL NOT WORK.
EXPORT TYPES
[1] <-> data = lib.callback.await('lb_vips:dataVIP', source) --> Returns a table {vip, level, lvlevel}
[2] <-> lib.callback('lb_vips:dataVIP', source, function(data)
data.vip --> Returns true or false
data.level --> Returns a number (vip level)
data.lvlabel --> Returns a string (vip level label)
end)
[3] <-> TriggerEvent('lb_vips:getVIPs', source, function(data)
data.vip --> Returns true or false
data.level --> Returns a number (vip level)
end)
EXAMPLES
This is an example of getting the VIP status, level and level label from a different resource using the option [1]:
RegisterCommand('testVIP',function(source,args)
local data = lib.callback.await('lb_vips:getVIPs', source)
if data.vip then
local level = data.level
local label = data.lvlabel
print('You\'re VIP with level: '..level..'!') --> Result: You're VIP with level: 3!
print('You\'re '..label) --> Result: You're VIP Diamond
else
print('You\'re not VIP') --> Result: You're not VIP
end
end)
This is an example of getting the VIP status, level and level label from a different resource using the option [2]:
RegisterCommand('testVIP',function(source,args)
lib.callback('lb_vips:getVIPs', source, function(data)
if data.vip then
local level = data.level
local label = data.lvlabel
print('You\'re VIP with level: '..level..'!') --> Result: You're VIP with level: 3!
print('You\'re '..label) --> Result: You're VIP Diamond
else
print('You\'re not VIP') --> Result: You're not VIP
end
end)
end)
This is an example of getting the VIP status and level from a different resource using the option [3]:
RegisterCommand('testVIP',function(source,args)
TriggerEvent('lb_vips:getVIPs', source, function(data)
if data.vip then
local level = data.level
print('You\'re VIP with level: '..level..'!') --> Result: You're VIP with level: 3!
else
print('You\'re not VIP') --> Result: You're not VIP
end
end)
end)