-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclient.lua
51 lines (50 loc) · 1.28 KB
/
client.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
local menuOpen
function openMenu(list)
WarMenu.CreateMenu('banlist', 'Banned Global')
WarMenu.SetSubTitle('banlist', 'Banned List')
WarMenu.CreateSubMenu('unban', 'banlist', 'Unban?')
menuOpen = true
WarMenu.OpenMenu('banlist')
local serial, key
Citizen.CreateThread(function()
while menuOpen do
Wait(0)
if WarMenu.Begin('banlist') then
for k,v in pairs(list) do
local hash = v.hash and v.hash or '#'
local name = v.name and v.name or '-'
if WarMenu.MenuButton("["..hash.."] "..name, 'unban') then
WarMenu.SetSubTitle('unban', "["..hash.."]"..name)
serial = v.hash
key = k
end
if WarMenu.IsItemHovered() then
WarMenu.ToolTip(v.reason, nil, true)
end
end
WarMenu.End()
elseif WarMenu.Begin('unban') then
if WarMenu.MenuButton("Back", 'unban') then
WarMenu.OpenMenu('banlist')
elseif WarMenu.MenuButton("Unban", 'unban') then
TriggerServerEvent('gban:remove', serial)
table.remove(list,key)
WarMenu.OpenMenu('banlist')
end
WarMenu.End()
end
if not WarMenu.IsAnyMenuOpened() then
menuOpen = false
end
end
end)
end
RegisterNetEvent('gban:list')
AddEventHandler('gban:list', function(list)
if list then
menuOpen = false
openMenu(list)
else
print('no banlist')
end
end)