-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.lua
56 lines (47 loc) · 1.12 KB
/
init.lua
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Core = {}
--- ESX ---
if GetResourceState('es_extended') == 'started' then
Core = exports["es_extended"]:getSharedObject()
if IsDuplicityVersion() then
AM.GetPlayer = function(source)
return Core.GetPlayerFromId(source)
end
else
AM.IsWhitelisted = function()
local jobName = Core.GetPlayerData().job.name
return AM.AllowedJobs[jobName]
end
end
return
end
--- QB ----
if GetResourceState('qb-core') == 'started' then
Core = exports['qb-core']:GetCoreObject()
if IsDuplicityVersion() then
AM.GetPlayer = function(source)
return {
source = source,
identifier = Core.Functions.GetIdentifier(source),
}
end
else
AM.IsWhitelisted = function()
local jobName = Core.Functions.GetPlayerData().job.name
return AM.AllowedJobs[jobName]
end
end
return
end
---- STANDALONE ------
if IsDuplicityVersion() then
AM.GetPlayer = function(source)
return {
identifier = GetPlayerIdentifierByType(source, 'license'),
source = source
}
end
else
AM.IsWhitelisted = function()
return true
end
end