forked from TanguyOrtegat/es_admin2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.lua
586 lines (510 loc) · 21.1 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
TriggerEvent("es:addGroup", "mod", "user", function(group) end)
-- Modify if you want, btw the _admin_ needs to be able to target the group and it will work
local groupsRequired = {
slay = "mod",
noclip = "admin",
crash = "superadmin",
freeze = "mod",
bring = "mod",
["goto"] = "mod",
slap = "mod",
slay = "mod",
kick = "mod",
ban = "admin"
}
local banned = ""
local bannedTable = {}
function loadBans()
banned = LoadResourceFile("es_admin2", "data/bans.txt") or ""
if banned then
local b = stringsplit(banned, "\n")
for k,v in ipairs(b) do
bannedTable[v] = true
end
end
if GetConvar("es_admin2_globalbans", "0") == "1" then
PerformHttpRequest("http://essentialmode.com/bans.txt", function(err, rText, headers)
local b = stringsplit(rText, "\n")
for k,v in pairs(b)do
bannedTable[v] = true
end
end)
end
end
function isBanned(id)
return bannedTable[id]
end
function banUser(id)
banned = banned .. id .. "\n"
SaveResourceFile("es_admin2", "data/bans.txt", banned, -1)
bannedTable[id] = true
end
AddEventHandler('playerConnecting', function(user, set)
for k,v in ipairs(GetPlayerIdentifiers(source))do
if isBanned(v) then
set(GetConvar("es_admin_banreason", "You're banned from this server"))
CancelEvent()
break
end
end
end)
RegisterServerEvent('es_admin:all')
AddEventHandler('es_admin:all', function(type)
local Source = source
TriggerEvent('es:getPlayerFromId', source, function(user)
TriggerEvent('es:canGroupTarget', user.getGroup(), "admin", function(available)
if available or user.getGroup() == "superadmin" then
if type == "slay_all" then TriggerClientEvent('es_admin:quick', -1, 'slay') end
if type == "bring_all" then TriggerClientEvent('es_admin:quick', -1, 'bring', Source) end
if type == "slap_all" then TriggerClientEvent('es_admin:quick', -1, 'slap') end
else
TriggerClientEvent('chatMessage', Source, "SYSTEM", {255, 0, 0}, "You do not have permission to do this")
end
end)
end)
end)
RegisterServerEvent('es_admin:quick')
AddEventHandler('es_admin:quick', function(id, type)
local Source = source
TriggerEvent('es:getPlayerFromId', source, function(user)
TriggerEvent('es:getPlayerFromId', id, function(target)
TriggerEvent('es:canGroupTarget', user.getGroup(), groupsRequired[type], function(available)
print('Available?: ' .. tostring(available))
TriggerEvent('es:canGroupTarget', user.getGroup(), target.getGroup(), function(canTarget)
if canTarget and available then
if type == "slay" then TriggerClientEvent('es_admin:quick', id, type) end
if type == "noclip" then TriggerClientEvent('es_admin:quick', id, type) end
if type == "freeze" then TriggerClientEvent('es_admin:quick', id, type) end
if type == "crash" then TriggerClientEvent('es_admin:quick', id, type) end
if type == "bring" then TriggerClientEvent('es_admin:quick', id, type, Source) end
if type == "goto" then TriggerClientEvent('es_admin:quick', Source, type, id) end
if type == "slap" then TriggerClientEvent('es_admin:quick', id, type) end
if type == "slay" then TriggerClientEvent('es_admin:quick', id, type) end
if type == "kick" then DropPlayer(id, 'Kicked by es_admin GUI') end
if type == "ban" then
for k,v in ipairs(GetPlayerIdentifiers(id))do
banUser(v)
end
DropPlayer(id, GetConvar("es_admin_banreason", "You were banned from this server"))
end
else
if not available then
TriggerClientEvent('chatMessage', Source, 'SYSTEM', {255, 0, 0}, "Your group can not use this command.")
else
TriggerClientEvent('chatMessage', Source, 'SYSTEM', {255, 0, 0}, "Permission denied.")
end
end
end)
end)
end)
end)
end)
AddEventHandler('es:playerLoaded', function(Source, user)
TriggerClientEvent('es_admin:setGroup', Source, user.getGroup())
end)
RegisterServerEvent('es_admin:set')
AddEventHandler('es_admin:set', function(t, USER, GROUP)
local Source = source
TriggerEvent('es:getPlayerFromId', source, function(user)
TriggerEvent('es:canGroupTarget', user.getGroup(), "admin", function(available)
if available then
if t == "group" then
if(GetPlayerName(USER) == nil)then
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Player not found")
else
TriggerEvent("es:getAllGroups", function(groups)
if(groups[GROUP])then
TriggerEvent("es:setPlayerData", USER, "group", GROUP, function(response, success)
TriggerClientEvent('es_admin:setGroup', USER, GROUP)
TriggerClientEvent('chatMessage', -1, "CONSOLE", {0, 0, 0}, "Group of ^2^*" .. GetPlayerName(tonumber(USER)) .. "^r^0 has been set to ^2^*" .. GROUP)
end)
else
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Group not found")
end
end)
end
elseif t == "level" then
if(GetPlayerName(USER) == nil)then
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Player not found")
else
GROUP = tonumber(GROUP)
if(GROUP ~= nil and GROUP > -1)then
TriggerEvent("es:setPlayerData", USER, "permission_level", GROUP, function(response, success)
if(true)then
TriggerClientEvent('chatMessage', -1, "CONSOLE", {0, 0, 0}, "Permission level of ^2" .. GetPlayerName(tonumber(USER)) .. "^0 has been set to ^2 " .. tostring(GROUP))
end
end)
else
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Invalid integer entered")
end
end
elseif t == "money" then
if(GetPlayerName(USER) == nil)then
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Player not found")
else
GROUP = tonumber(GROUP)
if(GROUP ~= nil and GROUP > -1)then
TriggerEvent('es:getPlayerFromId', USER, function(target)
target.setMoney(GROUP)
end)
else
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Invalid integer entered")
end
end
elseif t == "bank" then
if(GetPlayerName(USER) == nil)then
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Player not found")
else
GROUP = tonumber(GROUP)
if(GROUP ~= nil and GROUP > -1)then
TriggerEvent('es:getPlayerFromId', USER, function(target)
target.setBankBalance(GROUP)
end)
else
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Invalid integer entered")
end
end
end
else
TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "superadmin required to do this")
end
end)
end)
end)
-- Rcon commands
AddEventHandler('rconCommand', function(commandName, args)
if commandName == 'setadmin' then
if #args ~= 2 then
RconPrint("Usage: setadmin [user-id] [permission-level]\n")
CancelEvent()
return
end
if(GetPlayerName(tonumber(args[1])) == nil)then
RconPrint("Player not ingame\n")
CancelEvent()
return
end
TriggerEvent("es:setPlayerData", tonumber(args[1]), "permission_level", tonumber(args[2]), function(response, success)
RconPrint(response)
if(true)then
print(args[1] .. " " .. args[2])
TriggerClientEvent('es:setPlayerDecorator', tonumber(args[1]), 'rank', tonumber(args[2]), true)
TriggerClientEvent('chatMessage', -1, "CONSOLE", {0, 0, 0}, "Permission level of ^2" .. GetPlayerName(tonumber(args[1])) .. "^0 has been set to ^2 " .. args[2])
end
end)
CancelEvent()
elseif commandName == 'setgroup' then
if #args ~= 2 then
RconPrint("Usage: setgroup [user-id] [group]\n")
CancelEvent()
return
end
if(GetPlayerName(tonumber(args[1])) == nil)then
RconPrint("Player not ingame\n")
CancelEvent()
return
end
TriggerEvent("es:getAllGroups", function(groups)
if(groups[args[2]])then
TriggerEvent("es:setPlayerData", tonumber(args[1]), "group", args[2], function(response, success)
if(true)then
TriggerClientEvent('es:setPlayerDecorator', tonumber(args[1]), 'group', tonumber(args[2]), true)
TriggerClientEvent('chatMessage', -1, "CONSOLE", {0, 0, 0}, "Group of ^2^*" .. GetPlayerName(tonumber(args[1])) .. "^r^0 has been set to ^2^*" .. args[2])
end
end)
else
RconPrint("This group does not exist.\n")
end
end)
CancelEvent()
elseif commandName == 'giverole' then
if #args < 2 then
RconPrint("Usage: giverole [user-id] [role]\n")
CancelEvent()
return
end
if(GetPlayerName(tonumber(args[1])) == nil)then
RconPrint("Player not ingame\n")
CancelEvent()
return
end
TriggerEvent("es:getPlayerFromId", tonumber(args[1]), function(user)
table.remove(args, 1)
user.giveRole(table.concat(args, " "))
TriggerClientEvent("chatMessage", user.get('source'), "SYSTEM", {255, 0, 0}, "You've been given a role: ^2" .. table.concat(args, " "))
end)
CancelEvent()
elseif commandName == 'removerole' then
if #args < 2 then
RconPrint("Usage: removerole [user-id] [role]\n")
CancelEvent()
return
end
if(GetPlayerName(tonumber(args[1])) == nil)then
RconPrint("Player not ingame\n")
CancelEvent()
return
end
TriggerEvent("es:getPlayerFromId", tonumber(args[1]), function(user)
table.remove(args, 1)
user.removeRole(table.concat(args, " "))
TriggerClientEvent("chatMessage", user.get('source'), "SYSTEM", {255, 0, 0}, "A role was removed: ^2" .. table.concat(args, " "))
end)
CancelEvent()
elseif commandName == 'setmoney' then
if #args ~= 2 then
RconPrint("Usage: setmoney [user-id] [money]\n")
CancelEvent()
return
end
if(GetPlayerName(tonumber(args[1])) == nil)then
RconPrint("Player not ingame\n")
CancelEvent()
return
end
TriggerEvent("es:getPlayerFromId", tonumber(args[1]), function(user)
if(user)then
user.setMoney(tonumber(args[2]))
RconPrint("Money set")
TriggerClientEvent('chatMessage', tonumber(args[1]), "CONSOLE", {0, 0, 0}, "Your money has been set to: ^2^*$" .. tonumber(args[2]))
end
end)
CancelEvent()
end
end)
-- Default commands
TriggerEvent('es:addCommand', 'admin', function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Level: ^*^2 " .. tostring(user.get('permission_level')))
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Group: ^*^2 " .. user.getGroup())
end, {help = "Shows what admin level you are and what group you're in"})
-- Default commands
TriggerEvent('es:addCommand', 'report', function(source, args, user)
table.remove(args, 1)
TriggerClientEvent('chatMessage', source, "REPORT", {255, 0, 0}, " (^2" .. GetPlayerName(source) .." | "..source.."^0) " .. table.concat(args, " "))
TriggerEvent("es:getPlayers", function(pl)
for k,v in pairs(pl) do
TriggerEvent("es:getPlayerFromId", k, function(user)
if(user.getPermissions() > 0 and k ~= source)then
TriggerClientEvent('chatMessage', k, "REPORT", {255, 0, 0}, " (^2" .. GetPlayerName(source) .." | "..source.."^0) " .. table.concat(args, " "))
end
end)
end
end)
end, {help = "Report a player or an issue", params = {{name = "report", help = "What you want to report"}}})
-- Append a message
function appendNewPos(msg)
local file = io.open('resources/[essential]/es_admin2/positions.txt', "a")
newFile = msg
file:write(newFile)
file:flush()
file:close()
end
-- Do them hashes
function doHashes()
lines = {}
for line in io.lines("resources/[essential]/es_admin2/input.txt") do
lines[#lines + 1] = line
end
return lines
end
RegisterServerEvent('es_admin:givePos')
AddEventHandler('es_admin:givePos', function(str)
appendNewPos(str)
end)
-- Noclip
TriggerEvent('es:addGroupCommand', 'noclip', "admin", function(source, args, user)
TriggerClientEvent("es_admin:noclip", source)
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Enable or disable noclip"})
-- Kicking
TriggerEvent('es:addGroupCommand', 'kick', "mod", function(source, args, user)
if args[2] then
if(GetPlayerName(tonumber(args[2])))then
local player = tonumber(args[2])
-- User permission check
TriggerEvent("es:getPlayerFromId", player, function(target)
local reason = args
table.remove(reason, 1)
table.remove(reason, 1)
if(#reason == 0)then
reason = "Kicked: You have been kicked from the server"
else
reason = "Kicked: " .. table.concat(reason, " ")
end
TriggerClientEvent('chatMessage', -1, "SYSTEM", {255, 0, 0}, "Player ^2" .. GetPlayerName(player) .. "^0 has been kicked(^2" .. reason .. "^0)")
DropPlayer(player, reason)
end)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Kick a user with the specified reason or no reason", params = {{name = "userid", help = "The ID of the player"}, {name = "reason", help = "The reason as to why you kick this player"}}})
-- Announcing
TriggerEvent('es:addGroupCommand', 'announce', "admin", function(source, args, user)
table.remove(args, 1)
TriggerClientEvent('chatMessage', -1, "ANNOUNCEMENT", {255, 0, 0}, "" .. table.concat(args, " "))
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Announce a message to the entire server", params = {{name = "announcement", help = "The message to announce"}}})
-- Freezing
local frozen = {}
TriggerEvent('es:addGroupCommand', 'freeze', "mod", function(source, args, user)
if args[2] then
if(GetPlayerName(tonumber(args[2])))then
local player = tonumber(args[2])
-- User permission check
TriggerEvent("es:getPlayerFromId", player, function(target)
if(frozen[player])then
frozen[player] = false
else
frozen[player] = true
end
TriggerClientEvent('es_admin:freezePlayer', player, frozen[player])
local state = "unfrozen"
if(frozen[player])then
state = "frozen"
end
TriggerClientEvent('chatMessage', player, "SYSTEM", {255, 0, 0}, "You have been " .. state .. " by ^2" .. GetPlayerName(source))
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Player ^2" .. GetPlayerName(player) .. "^0 has been " .. state)
end)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Freeze or unfreeze a user", params = {{name = "userid", help = "The ID of the player"}}})
-- Bring
local frozen = {}
TriggerEvent('es:addGroupCommand', 'bring', "mod", function(source, args, user)
if args[2] then
if(GetPlayerName(tonumber(args[2])))then
local player = tonumber(args[2])
-- User permission check
TriggerEvent("es:getPlayerFromId", player, function(target)
TriggerClientEvent('es_admin:teleportUser', target.get('source'), user.getCoords().x, user.getCoords().y, user.getCoords().z)
TriggerClientEvent('chatMessage', player, "SYSTEM", {255, 0, 0}, "You have brought by ^2" .. GetPlayerName(source))
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Player ^2" .. GetPlayerName(player) .. "^0 has been brought")
end)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Teleport a user to you", params = {{name = "userid", help = "The ID of the player"}}})
-- Bring
local frozen = {}
TriggerEvent('es:addGroupCommand', 'slap', "admin", function(source, args, user)
if args[2] then
if(GetPlayerName(tonumber(args[2])))then
local player = tonumber(args[2])
-- User permission check
TriggerEvent("es:getPlayerFromId", player, function(target)
TriggerClientEvent('es_admin:slap', player)
TriggerClientEvent('chatMessage', player, "SYSTEM", {255, 0, 0}, "You have slapped by ^2" .. GetPlayerName(source))
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Player ^2" .. GetPlayerName(player) .. "^0 has been slapped")
end)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Slap a user", params = {{name = "userid", help = "The ID of the player"}}})
-- Freezing
local frozen = {}
TriggerEvent('es:addGroupCommand', 'goto', "mod", function(source, args, user)
if args[2] then
if(GetPlayerName(tonumber(args[2])))then
local player = tonumber(args[2])
-- User permission check
TriggerEvent("es:getPlayerFromId", player, function(target)
if(target)then
TriggerClientEvent('es_admin:teleportUser', source, target.getCoords().x, target.getCoords().y, target.getCoords().z)
TriggerClientEvent('chatMessage', player, "SYSTEM", {255, 0, 0}, "You have been teleported to by ^2" .. GetPlayerName(source))
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Teleported to player ^2" .. GetPlayerName(player) .. "")
end
end)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Teleport to a user", params = {{name = "userid", help = "The ID of the player"}}})
-- Kill yourself
TriggerEvent('es:addCommand', 'die', function(source, args, user)
TriggerClientEvent('es_admin:kill', source)
TriggerClientEvent('chatMessage', source, "", {0,0,0}, "^1^*You killed yourself.")
end, {help = "Suicide"})
-- Killing
TriggerEvent('es:addGroupCommand', 'slay', "admin", function(source, args, user)
if args[2] then
if(GetPlayerName(tonumber(args[2])))then
local player = tonumber(args[2])
-- User permission check
TriggerEvent("es:getPlayerFromId", player, function(target)
TriggerClientEvent('es_admin:kill', player)
TriggerClientEvent('chatMessage', player, "SYSTEM", {255, 0, 0}, "You have been killed by ^2" .. GetPlayerName(source))
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Player ^2" .. GetPlayerName(player) .. "^0 has been killed.")
end)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Slay a user", params = {{name = "userid", help = "The ID of the player"}}})
-- Crashing
TriggerEvent('es:addGroupCommand', 'crash', "superadmin", function(source, args, user)
if args[2] then
if(GetPlayerName(tonumber(args[2])))then
local player = tonumber(args[2])
-- User permission check
TriggerEvent("es:getPlayerFromId", player, function(target)
TriggerClientEvent('es_admin:crash', player)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Player ^2" .. GetPlayerName(player) .. "^0 has been crashed.")
end)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
end
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Crash a user, no idea why this still exists", params = {{name = "userid", help = "The ID of the player"}}})
-- Position
TriggerEvent('es:addGroupCommand', 'pos', "owner", function(source, args, user)
TriggerClientEvent('es_admin:givePosition', source)
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end, {help = "Save position to file"})
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
loadBans()