-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserver.lua
35 lines (31 loc) · 898 Bytes
/
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
local function isAdmin(source)
local allowed = false
for i,id in ipairs(Config.EAS.admins) do
for x,pid in ipairs(GetPlayerIdentifiers(source)) do
if string.lower(pid) == string.lower(id) then
allowed = true
end
end
end
if IsPlayerAceAllowed(source, "lance.eas") then
allowed = true
else
print("NOT ALLOWED TO USE EAS")
allowed = false
end
return allowed
end
RegisterCommand("eas-lspd", function(source, args, rawCommand)
if (isAdmin(source)) then
CancelEvent()
local msg = table.concat(args, " ")
TriggerClientEvent("SendAlert", -1, "Los Santos Police Department", msg)
end
end)
RegisterCommand("eas-lsfd", function(source, args, rawCommand)
if (isAdmin(source)) then
CancelEvent()
local msg = table.concat(args, " ")
TriggerClientEvent("SendAlert", -1, "Los Santos Fire Department", msg)
end
end)