Hey there FiveM community, I don’t know what causes this problem, but when I do the /report command, it only works when I do //report. I will paste the code down here, so if you know what causes it, I would be very glad! Thanks in advance.
The code:
TriggerEvent(‘es:addCommand’, ‘report’, function(source, args, user)
TriggerClientEvent(‘chat:addMessage’, source, {
args = {"^1REPORT", " (^2" .. GetPlayerName(source) .. " | " .. source .. "^0) " .. table.concat(args, " ")}
})
TriggerEvent(“es:getPlayers”, function(pl)
for k,v in pairs(pl) do
TriggerEvent("es:getPlayerFromId", k, function(user)
if(user.getPermissions() > 0 and k ~= source)then
TriggerClientEvent('chat:addMessage', k, {
args = {"^1REPORT", " (^2" .. GetPlayerName(source) .." | "..source.."^0) " .. table.concat(args, " ")}
})
end
end)
end
end)
end, {help = “Report a player or an issue”, params = {{name = “report”, help = “What you want to report”}}})