-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.lua
61 lines (49 loc) · 2.24 KB
/
server.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
57
58
59
60
61
local QBCore = exports["qb-core"]:GetCoreObject()
exports("getMemberFromGroupByCitizenId", function(...) exports["imm-groups"]:getMemberFromGroup(...) end)
exports("addMemberToGroupByCitizenId", function(...) exports["imm-groups"]:addMemberToGroup(...) end)
exports("removeMemberFromGroupByCitizenId", function(...) exports["imm-groups"]:removeMemberFromGroup(...) end)
exports("getMemberStateByCitizenId", function(...) exports["imm-groups"]:getMemberState(...) end)
exports("setMemberStateByCitizenId", function(...) exports["imm-groups"]:setMemberState(...) end)
exports("getGroupsFromMemberByCitizenId", function(...) exports["imm-groups"]:getGroupsFromMember(...) end)
exports("getMemberFromGroupBySource", function(groupId, source)
local player = QBCore.Functions.GetPlayer(source)
if (not player) then
return false
end
return exports["imm-groups"]:getMemberFromGroup(groupId, player.PlayerData.citizenid)
end)
exports("addMemberToGroupBySource", function(groupId, source)
local player = QBCore.Functions.GetPlayer(source)
if (not player) then
return false
end
return exports["imm-groups"]:addMemberToGroup(groupId, player.PlayerData.citizenid)
end)
exports("removeMemberFromGroupBySource", function(groupId, source)
local player = QBCore.Functions.GetPlayer(source)
if (not player) then
return false
end
return exports["imm-groups"]:removeMemberFromGroup(groupId, player.PlayerData.citizenid)
end)
exports("getMemberStateBySource", function(groupId, source, key)
local player = QBCore.Functions.GetPlayer(source)
if (not player) then
return false
end
return exports["imm-groups"]:getMemberState(groupId, player.PlayerData.citizenid, key)
end)
exports("setMemberStateBySource", function(groupId, source, key, value)
local player = QBCore.Functions.GetPlayer(source)
if (not player) then
return false
end
return exports["imm-groups"]:setMemberState(groupId, player.PlayerData.citizenid, key, value)
end)
exports("getGroupsFromMemberBySource", function(source)
local player = QBCore.Functions.GetPlayer(source)
if (not player) then
return false
end
return true, exports["imm-groups"]:getGroupsFromMember(player.PlayerData.citizenid)
end)