it looks like this
RegisterCommand("report", function(source, args, rawCommand)
local reason = table.concat(args," ")
if reason=="" or not reason then TriggerClientEvent('esx:showAdvancedColoredNotification', source, 'Phoenix', '~o~Reports', 'Tu as pas mis de raison a ton report', 'CHAR_PHOENIX', 1, 2); return end
if not open_assists[source] and not active_assists[source] then
local ac = execOnAdmins(function(admin)
TriggerClientEvent("pnStaff:requestedAssist",admin,source, reason);
TriggerClientEvent("pnStaff:tablingAssist",admin,source, reason);
--TriggerClientEvent("chat:addMessage",admin,{color={0,255,255},multiline=Config.chatassistformat:find("\n")~=nil,args={"BWH",Config.chatassistformat:format(GetPlayerName(source),source,reason)}})
end)
if ac>0 then
open_assists[source]=reason
Citizen.SetTimeout(120000,function()
if open_assists[source] then open_assists[source]=nil end
if GetPlayerName(source)~=nil then
TriggerClientEvent('esx:showAdvancedColoredNotification', source, 'Phoenix', '~o~Reports', 'Ton ~y~Report~w~ a ~r~expiré', 'CHAR_PHOENIX', 1, 2)
end
end)
TriggerClientEvent('esx:showAdvancedColoredNotification', source, 'Phoenix', '~o~Reports', 'On a bien recu ton ~r~report~w~, il expire dans 120s. \n~b~/cassist~b~ pour le fermer', 'CHAR_PHOENIX', 1, 2)
else
TriggerClientEvent('esx:showAdvancedColoredNotification', source, 'Phoenix', '~o~Reports', 'Désolé mec, y\'as ~r~0~w~ ~b~staff~w~ en ville', 'CHAR_PHOENIX', 1, 2)
end
else
TriggerClientEvent('esx:showAdvancedColoredNotification', source, 'Phoenix', '~o~Reports', 'Un staff s\'occupe déjà de toi ou tu as un ticket en attente', 'CHAR_PHOENIX', 1, 2)
end
end)