Skip to content

Commit

Permalink
fix(Server): staffchat not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycroft-Studios committed Jul 15, 2024
1 parent 94cb7a2 commit bf97942
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,16 @@ QBCore.Commands.Add('staffchat', Lang:t('commands.staffchat_message'), { { name
local plrs = GetPlayers()

for _, plr in ipairs(plrs) do
if QBCore.Functions.HasPermission(plr, 'admin') or IsPlayerAceAllowed(plr, 'command') then
if QBCore.Functions.IsOptin(plr) then
TriggerClientEvent('chat:addMessage', plr, {
color = { 255, 0, 0 },
multiline = true,
args = { Lang:t('info.staffchat') .. name, msg }
})
plr = tonumber(plr)
if plr then
if QBCore.Functions.HasPermission(plr, 'admin') or IsPlayerAceAllowed(plr, 'command') then
if QBCore.Functions.IsOptin(plr) then
TriggerClientEvent('chat:addMessage', plr, {
color = { 255, 0, 0 },
multiline = true,
args = { Lang:t('info.staffchat') .. name, msg }
})
end
end
end
end
Expand Down

0 comments on commit bf97942

Please sign in to comment.