mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
Gang Grades
This commit is contained in:
+7
-5
@@ -120,12 +120,14 @@ QBCore.Commands.Add("job", "Check Your Job", {}, false, function(source, args)
|
||||
TriggerClientEvent('QBCore:Notify', source, "Job: "..Player.PlayerData.job.label.. " Grade: "..Player.PlayerData.job.grade.name)
|
||||
end)
|
||||
|
||||
QBCore.Commands.Add("setgang", "Set A Players Gang (Admin Only)", {{name="id", help="Player ID"}, {name="job", help="Name of a gang"}}, true, function(source, args)
|
||||
QBCore.Commands.Add("setgang", "Set A Players Gang (Admin Only)", {{name="id", help="Player ID"}, {name="job", help="Name of a gang"}, {name="grade", help="Grade"}}, true, function(source, args)
|
||||
local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
|
||||
if Player ~= nil then
|
||||
Player.Functions.SetGang(tostring(args[2]))
|
||||
else
|
||||
if (args[1] == nil) or (args[2] == nil) or (args[3] == nil) then
|
||||
TriggerClientEvent('QBCore:Notify', source, "All Arguments Must Be Filled", "error")
|
||||
elseif Player == nil then
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player Not Online", "error")
|
||||
else
|
||||
Player.Functions.SetGang(tostring(args[2]), tonumber(args[3]))
|
||||
end
|
||||
end, "admin")
|
||||
|
||||
@@ -133,7 +135,7 @@ QBCore.Commands.Add("gang", "Check Your Gang", {}, false, function(source, args)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
|
||||
if Player.PlayerData.gang.name ~= "none" then
|
||||
TriggerClientEvent('QBCore:Notify', source, "Gang: "..Player.PlayerData.gang.label)
|
||||
TriggerClientEvent('QBCore:Notify', source, "Gang: "..Player.PlayerData.gang.label.. " Grade: "..Player.PlayerData.gang.grade.name)
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, "No Gang Affiliation", "error")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user