Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Server script esx_identity
- -- Getting information if player is on State 1 in VIP
- function getVip(source, callback)
- local identifier = GetPlayerIdentifiers(source)[1]
- MySQL.Async.fetchAll('SELECT vip FROM `users` WHERE `identifier` = @identifier', {
- ['@identifier'] = identifier
- }, function(result)
- local data = {
- identifier = result[1].identifier,
- vip = result[1].vip
- }
- callback(data)
- end)
- end
- -- Restricting the Command so that VIP's only can use this
- TriggerEvent('es:addCommand', 'register', function(source, args, user)
- if data.vip == 1 then
- getCharacters(source, function(data)
- if data.firstname3 ~= '' then
- TriggerClientEvent('chat:addMessage', source, { args = { '^[IDENTITY]', 'You can only have 3 registered characters. Use the ^3/chardel^0 command in order to delete existing characters.' } })
- else
- TriggerClientEvent('esx_identity:showRegisterIdentity', source, {})
- end
- end)
- else
- TriggerClientEvent('chat:addMessage', source, { args = { '^[DUSK CITY]', 'Du hast keine Berechtigung dies zu tun.'} })
- end
- end, {help = "Register a new character"})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement