mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 09:13:29 +00:00
Notifications instead of chat
This commit is contained in:
+11
-11
@@ -30,7 +30,7 @@ QBCore.Commands.Add("tp", "Teleport to a player or location", {{name="id/x", hel
|
||||
if Player ~= nil then
|
||||
TriggerClientEvent('QBCore:Command:TeleportToPlayer', source, Player.PlayerData.source)
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
else
|
||||
-- tp to location
|
||||
@@ -40,7 +40,7 @@ QBCore.Commands.Add("tp", "Teleport to a player or location", {{name="id/x", hel
|
||||
local z = tonumber(args[3])
|
||||
TriggerClientEvent('QBCore:Command:TeleportToCoords', source, x, y, z)
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Not every argument has been entered (x, y, z)")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Not every argument has been entered (x, y, z)", "error")
|
||||
end
|
||||
end
|
||||
end, "admin")
|
||||
@@ -51,7 +51,7 @@ QBCore.Commands.Add("addpermission", "Grant permissions to someone (god/admin)",
|
||||
if Player ~= nil then
|
||||
QBCore.Functions.AddPermission(Player.PlayerData.source, permission)
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
end, "god")
|
||||
|
||||
@@ -60,7 +60,7 @@ QBCore.Commands.Add("removepermission", "Remove permissions from someone", {{nam
|
||||
if Player ~= nil then
|
||||
QBCore.Functions.RemovePermission(Player.PlayerData.source)
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
end, "god")
|
||||
|
||||
@@ -85,7 +85,7 @@ QBCore.Commands.Add("givemoney", "Give money to a player", {{name="id", help="Pl
|
||||
if Player ~= nil then
|
||||
Player.Functions.AddMoney(tostring(args[2]), tonumber(args[3]))
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
end, "admin")
|
||||
|
||||
@@ -94,7 +94,7 @@ QBCore.Commands.Add("setmoney", "set a players money amount", {{name="id", help=
|
||||
if Player ~= nil then
|
||||
Player.Functions.SetMoney(tostring(args[2]), tonumber(args[3]))
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
end, "admin")
|
||||
|
||||
@@ -103,13 +103,13 @@ QBCore.Commands.Add("setjob", "Assign a job to a player", {{name="id", help="Spe
|
||||
if Player ~= nil then
|
||||
Player.Functions.SetJob(tostring(args[2]))
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
end, "admin")
|
||||
|
||||
QBCore.Commands.Add("job", "See what job you have", {}, false, function(source, args)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "warning", "Job: "..Player.PlayerData.job.label)
|
||||
TriggerClientEvent('QBCore:Notify', source, "Job: "..Player.PlayerData.job.label)
|
||||
end)
|
||||
|
||||
QBCore.Commands.Add("setgang", "Assign a player to a gang", {{name="id", help="Player ID"}, {name="job", help="Name of a gang"}}, true, function(source, args)
|
||||
@@ -117,7 +117,7 @@ QBCore.Commands.Add("setgang", "Assign a player to a gang", {{name="id", help="P
|
||||
if Player ~= nil then
|
||||
Player.Functions.SetGang(tostring(args[2]))
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
end, "admin")
|
||||
|
||||
@@ -125,7 +125,7 @@ QBCore.Commands.Add("gang", "See what gang you're in", {}, false, function(sourc
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
|
||||
if Player.PlayerData.gang.name ~= "geen" then
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "warning", "Gang: "..Player.PlayerData.gang.label)
|
||||
TriggerClientEvent('QBCore:Notify', source, "Gang: "..Player.PlayerData.gang.label)
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, "You're not in a gang!", "error")
|
||||
end
|
||||
@@ -141,7 +141,7 @@ QBCore.Commands.Add("clearinv", "Clear the inventory of a player", {{name="id",
|
||||
if Player ~= nil then
|
||||
Player.Functions.ClearInventory()
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Player is not online!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player is not online!", "error")
|
||||
end
|
||||
end, "admin")
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ AddEventHandler('chatMessage', function(source, n, message)
|
||||
table.remove(args, 1)
|
||||
if (QBCore.Functions.HasPermission(source, "god") or QBCore.Functions.HasPermission(source, QBCore.Commands.List[command].permission)) then
|
||||
if (QBCore.Commands.List[command].argsrequired and #QBCore.Commands.List[command].arguments ~= 0 and args[#QBCore.Commands.List[command].arguments] == nil) then
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "All arguments must be filled out!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "All arguments must be filled out!", "error")
|
||||
local agus = ""
|
||||
for name, help in pairs(QBCore.Commands.List[command].arguments) do
|
||||
agus = agus .. " ["..help.name.."]"
|
||||
@@ -201,7 +201,7 @@ AddEventHandler('chatMessage', function(source, n, message)
|
||||
QBCore.Commands.List[command].callback(source, args)
|
||||
end
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "No access to this command!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "No Access To This Command", "error")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -215,7 +215,7 @@ AddEventHandler('QBCore:CallCommand', function(command, args)
|
||||
if Player ~= nil then
|
||||
if (QBCore.Functions.HasPermission(source, "god")) or (QBCore.Functions.HasPermission(source, QBCore.Commands.List[command].permission)) or (QBCore.Commands.List[command].permission == Player.PlayerData.job.name) then
|
||||
if (QBCore.Commands.List[command].argsrequired and #QBCore.Commands.List[command].arguments ~= 0 and args[#QBCore.Commands.List[command].arguments] == nil) then
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "All arguments must be filled out!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "All arguments must be filled out!", "error")
|
||||
local agus = ""
|
||||
for name, help in pairs(QBCore.Commands.List[command].arguments) do
|
||||
agus = agus .. " ["..help.name.."]"
|
||||
@@ -225,7 +225,7 @@ AddEventHandler('QBCore:CallCommand', function(command, args)
|
||||
QBCore.Commands.List[command].callback(source, args)
|
||||
end
|
||||
else
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "No access to this command!")
|
||||
TriggerClientEvent('QBCore:Notify', source, "No Access To This Command", "error")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -237,7 +237,7 @@ QBCore.Player.CreatePlayer = function(PlayerData)
|
||||
self.Functions.AddItem = function(item, amount, slot, info)
|
||||
local totalWeight = QBCore.Player.GetTotalWeight(self.PlayerData.items)
|
||||
local itemInfo = QBCore.Shared.Items[item:lower()]
|
||||
if itemInfo == nil then TriggerClientEvent('chatMessage', -1, "SYSTEM", "warning", "No item found??") return end
|
||||
if itemInfo == nil then TriggerClientEvent('QBCore:Notify', -1, "Item Does Not Exist", "error") return end
|
||||
local amount = tonumber(amount)
|
||||
local slot = tonumber(slot) ~= nil and tonumber(slot) or QBCore.Player.GetFirstSlotByItem(self.PlayerData.items, item)
|
||||
if itemInfo["type"] == "weapon" and info == nil then
|
||||
|
||||
Reference in New Issue
Block a user