-
Notifications
You must be signed in to change notification settings - Fork 6
/
server.lua
34 lines (28 loc) · 1.25 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
if QBCore == nil then
RegisterCommand("riot", function(source, args, raw)
local src = source
TriggerClientEvent("Riot:ToggleRiot", src)
end)
RegisterCommand("riot2", function(source, args, raw)
local src = source
TriggerClientEvent("Riot:ToggleBalRiot", src)
end)
else
local QBCore = exports['qb-core']:GetCoreObject()
QBCore.Commands.Add("riot", "Gives Riot Shield (Police Only)", {}, false, function(source)
local Player = QBCore.Functions.GetPlayer(source)
if Player.PlayerData.job.name == "police" then
TriggerClientEvent("Riot:ToggleRiot", source)
else
TriggerClientEvent('QBCore:Notify', source, "For Police Officer Only", "error")
end
end)
QBCore.Commands.Add("riot2", "Gives Ballistic Riot Shield (Police Only)", {}, false, function(source)
local Player = QBCore.Functions.GetPlayer(source)
if Player.PlayerData.job.name == "police" then
TriggerClientEvent("Riot:ToggleBalRiot", source)
else
TriggerClientEvent('QBCore:Notify', source, "For Police Officer Only", "error")
end
end)
end