Configuration
On this page, we will explain how you can configure the resource to your liking.
Configuration File
Config = {}
Config.Debug = true
Config.FrameworkData = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject',
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject',
}
}
Config.Language = 'es' -- 'es' or 'en'
Config.MenuAlign = 'bottom-right' -- 'top-left' or 'top-right' or 'bottom-left' or 'bottom-right'
Config.UseIdentifier = 'license' -- 'license' or 'steam'
Config.DiscordRoles = {
enable = false, -- If you activate this, it is necessary to insert your bot token in server/editablesv.lua
serverId = 'SERVER_ID', --Enter the ID of your Discord server.
}
-- VARIABLES
--@ label: Label to identity the VIP
--@ priority: Priority power to connectqueue
--@ points: Amount to receive in case the payment system is active
--@ roleID: The identifier of the role to give, if you don't want to give any, leave it as 0.
Config.Vips = {
["vip_plata"] = { label = 'VIP Plata', priority = 100, points = 10, roleID = '0' },
["vip_oro"] = { label = 'VIP Oro', priority = 200, points = 300, roleID = '0' },
["vip_diamante"] = { label = 'VIP Diamante', priority = 400, points = 20, roleID = '0' },
}
Config.PaycheckSystem = {
enable = true,
account = 'bank',
interval = 1, -- minutes
paidWithoutVip = false, -- Do you want to pay non-VIP users?
pointWithoutVipQuantity = 5, -- How many money do you want to give to non-VIP users?
}
Config.GroupPermissions = {
'god',
'admin',
'superadmin',
}
Config.Commands = {
['redeem_code'] = 'code',
['open_vip_menu'] = 'vipmenu',
}
Config.DiscordLogs = {
enable = true,
webhook_givevips = 'WEBHOOK_HERE',
webhook_removevips = 'WEBHOOK_HERE',
webhook_generateCode = 'WEBHOOK_HERE',
webhook_editVIP = 'WEBHOOK_HERE',
}
Lang = {
['en'] = {
general = {
titlle = 'VIPs System',
days = 'Days',
player_id = 'ID of the User',
id_not_found = 'No user with this ID',
},
menu = {
addvip = 'Give VIP',
lsitvips = 'VIPs List',
createcode = 'Generate code',
not_vips_active = 'There is no active VIP',
edit_vip = 'Edit',
remove_vip = 'Remove',
lifetime = 'Lifetime',
},
dialog = {
viptype = 'VIP Type',
days_remaining = 'Remaining days',
current_vip = 'Current VIP',
editing_vip = 'Editing VIP of %s'
},
commands = {
menu_help = 'Open VIP menu (Only Staff)',
redem_code_help = 'Redeem a code',
redem_code = 'Code to redeem'
},
notify = {
code_generated = 'The code generated for the %s It has been copied on your clipboard',
user_already_have_vip = 'This user already has an active VIP',
need_code = 'You have to enter the code to redeem',
redeemed_vip = 'You have redeemed the VIP correctly',
vip_current_active = 'You currently have an active VIP, wait for the same ending to exchange',
code_not_found = 'This code does not exist',
vip_deleted = 'The VIP has been removed from %s',
vip_added = 'The VIP has been delivered %s',
vip_received = 'They have given you a %s for %s days',
vip_edited = 'You have successfully edited the VIP of %s',
vip_permanent_received = 'They have given you a %s permanently',
},
discordlog = {
title_addVIP = 'VIP DELIVERED',
title_generateCode = 'CODE GENERATED',
title_removeVIP = 'VIP REMOVED',
title_editVIP = 'VIP EDITED',
editVIP = '%s has edited the VIP of %s',
addVIP = '%s has delivered a %s to %s for %s days',
removeVIP = '%s has removed the vip from %s',
generateCode = '%s generated the code %s for the %s with a duration of %s days',
}
},
['es'] = {
general = {
titlle = 'Sistema de VIPs',
days = 'Dias',
player_id = 'ID del Usuario',
id_not_found = 'No se encontro ningun usuario con esta ID',
},
menu = {
addvip = 'Entregar VIP',
lsitvips = 'Lista VIPs',
createcode = 'Generar Codigo',
not_vips_active = 'No hay ningun VIP activo',
edit_vip = 'Editar',
remove_vip = 'Quitar',
lifetime = 'Permanente',
},
dialog = {
viptype = 'Tipo VIP',
days_remaining = 'Dias Restantes',
current_vip = 'VIP Actual',
editing_vip = 'Editando VIP de %s'
},
commands = {
menu_help = 'Abrir menu VIP (Solo Staff)',
redem_code_help = 'Canjear un Codigo',
redem_code = 'Codigo a Canjear'
},
notify = {
code_generated = 'El codigo generado para el %s se ha copiado en tu porta papeles',
user_already_have_vip = 'Este usuario ya tiene un VIP activo',
need_code = 'Tienes que ingresar el codigo a canjear',
redeemed_vip = 'Has canjeado el VIP correctamente',
vip_current_active = 'Actualmente tienes un VIP activo, espera a que el mismo finalice para canjear',
code_not_found = 'Este codigo no existe',
vip_deleted = 'Se le ha removido el VIP de %s',
vip_added = 'Se ha entregado el VIP a %s',
vip_received = 'Te han entregado un %s por %s dias',
vip_edited = 'Se ha modificado correctamente el VIP de %s',
vip_permanent_received = 'Te han entregado un %s permanentemente',
},
discordlog = {
title_addVIP = 'VIP ENTREGADO',
title_generateCode = 'CODIGO GENERADO',
title_removeVIP = 'VIP ELIMINADO',
title_editVIP = 'VIP EDITADO',
editVIP = '%s ha editado el VIP de %s',
addVIP = '%s a entregado un %s a %s por %s dias',
removeVIP = '%s ha eliminado el vip de %s',
generateCode = '%s a generado el codigo %s para el %s con duracion de %s dias',
}
},
}
function notify(msg, type)
-- type = 'inform' or 'error' or 'success'
lib.notify({
title = Lang[Config.Language].general.titlle,
description = msg,
duration = 7000,
position = 'top',
type = type
})
end
botToken = 'YOUR_BOT_TOKEN'
RegisterNetEvent('gcm_vips:notifyPaycheck', function(source, ammount, isVip)
if isVip then
TriggerClientEvent('gcm_vips:client:notify', source, 'You have received a bonus $'..ammount..' for your VIP', 'success')
else
TriggerClientEvent('gcm_vips:client:notify', source, 'You have received a bonus $'..ammount..' If you want to increase this acquire a membership', 'success')
end
end)
RegisterNetEvent('gcm_vips:server:OnVipAdd', function(targetID, vip_type)
--Here you can add additional actions when a VIP is given.
end)
--* CHECK IF PLAYER IS STAFF
function isPlayerStaff(src)
if Config.Framework == 'qb-core' then
local permissions = QBCore.Functions.GetPermission(src)
for _, permission in ipairs(Config.GroupPermissions) do
if IsPlayerAceAllowed(src, permission) or IsPlayerAceAllowed(src, 'command') or permissions[permission] then
return true
end
end
return false
elseif Config.Framework == 'es_extended' then
local xPlayer = ESX.GetPlayerFromId(src)
local group = 'user'
if xPlayer then
group = xPlayer.getGroup()
end
for _, permission in ipairs(Config.GroupPermissions) do
if IsPlayerAceAllowed(src, permission) or IsPlayerAceAllowed(src, 'command') or permission == group then
return true
end
end
return false
end
end
Last updated