-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
26 lines (24 loc) · 987 Bytes
/
server.lua
File metadata and controls
26 lines (24 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if Config.Framework == 'esx' then
ESX = exports['es_extended']:getSharedObject()
elseif Config.Framework == 'qbcore' then
QBCore = exports['qb-core']:GetCoreObject()
end
RegisterCommand('ped', function(source, args, rawCommand)
local license
if Config.Framework == 'esx' then
local xPlayer = ESX.GetPlayerFromId(source)
license = xPlayer.identifier
elseif Config.Framework == 'qbcore' then
local Player = QBCore.Functions.GetPlayer(source)
license = Player.PlayerData.license
end
if Config.AllowedPeds[license] then
TriggerClientEvent('pedmenu:setPed', source, Config.AllowedPeds[license])
else
if Config.Framework == 'esx' then
TriggerClientEvent('esx:showNotification', source, 'Nemáš prístup do PedMenu!')
elseif Config.Framework == 'qbcore' then
TriggerClientEvent('QBCore:Notify', source, 'Nemáš prístup do PedMenu!', 'error')
end
end
end, false)