- Initiateur de la discussion
theosol
Geek suprême
- Messages
- 305
- Score réaction
- 12
- Points
- 115
Penser vous que mon code est bon pour donner des notif au joueur ???
local friteT = {}
friteT.AdminGroups = {
"superadmin",
"Administrateur",
"admin",
"Modérateur",
"Gérant Staff",
"Modérateur-Test"
}
-----------------------------------------------------
if SERVER then
util.AddNetworkString("open_ticket_menu")
util.AddNetworkString("color_message_as")
function sendPopup(noob,message)
net.Start("color_message_as")
net.WriteString(message)
net.Send(ply)
end
hook.Add("PlayerSay", "AdmiNState",function(ply, text)
if string.Left(text,3) == "///" then
net.Start("open_ticket_menu")
net.Send(ply)
elseif text == "!admin" then
ply:ConCommand("AS_GO")
end
end)
hook.Add("PlayerInitialSpawn","Checksipopup", function(ply)
if table.HasValue( friteT.AdminGroups, ply:GetUserGroup() ) then
ply:SetNWString("Admin_State", "Non disponible")
end
end)
concommand.Add( "AS_2MIN", function( ply, cmd, args )
local ticketply = player.GetBySteamID64(args[1])
ticketply:SetNWString("TicketEnCours_time","moins de 2 minutes")
DarkRP.notify(ticketply, 3, 10, "Votre ticket admin va être traité dans moins de 2 minutes")
end)
concommand.Add( "AS_JRV", function( ply, cmd, args )
local ticketply = player.GetBySteamID64(args[1])
ticketply:SetNWString("TicketEnCours_time","30 secondes")
DarkRP.notify(ticketply, 3, 10, "Veulliez patienter nous traiton votre demande")
end)
concommand.Add( "AS_GER", function( ply, cmd, args )
local ticketply = player.GetBySteamID64(args[1])
ticketply:SetNWString("TicketEnCours_time","Entretien avec l'administrateur")
DarkRP.notify(ticketply, 3, 5, "Le ticket avec le Staff "..ply:Nick().." commence")
end)
end
if CLIENT then
net.Receive("color_message_as", function()
local msg = net.ReadString()
if LocalPlayer():GetNWString("Admin_State") == "En service" then
chat.AddText(Color(255,255,255),"[",Color( 255, 0, 0 ), "NOTIFICATION", Color(255,255,255),"] "..msg)
end
end)
end
c'est un fichier que j'ai cree dans l'addons
local friteT = {}
friteT.AdminGroups = {
"superadmin",
"Administrateur",
"admin",
"Modérateur",
"Gérant Staff",
"Modérateur-Test"
}
-----------------------------------------------------
if SERVER then
util.AddNetworkString("open_ticket_menu")
util.AddNetworkString("color_message_as")
function sendPopup(noob,message)
net.Start("color_message_as")
net.WriteString(message)
net.Send(ply)
end
hook.Add("PlayerSay", "AdmiNState",function(ply, text)
if string.Left(text,3) == "///" then
net.Start("open_ticket_menu")
net.Send(ply)
elseif text == "!admin" then
ply:ConCommand("AS_GO")
end
end)
hook.Add("PlayerInitialSpawn","Checksipopup", function(ply)
if table.HasValue( friteT.AdminGroups, ply:GetUserGroup() ) then
ply:SetNWString("Admin_State", "Non disponible")
end
end)
concommand.Add( "AS_2MIN", function( ply, cmd, args )
local ticketply = player.GetBySteamID64(args[1])
ticketply:SetNWString("TicketEnCours_time","moins de 2 minutes")
DarkRP.notify(ticketply, 3, 10, "Votre ticket admin va être traité dans moins de 2 minutes")
end)
concommand.Add( "AS_JRV", function( ply, cmd, args )
local ticketply = player.GetBySteamID64(args[1])
ticketply:SetNWString("TicketEnCours_time","30 secondes")
DarkRP.notify(ticketply, 3, 10, "Veulliez patienter nous traiton votre demande")
end)
concommand.Add( "AS_GER", function( ply, cmd, args )
local ticketply = player.GetBySteamID64(args[1])
ticketply:SetNWString("TicketEnCours_time","Entretien avec l'administrateur")
DarkRP.notify(ticketply, 3, 5, "Le ticket avec le Staff "..ply:Nick().." commence")
end)
end
if CLIENT then
net.Receive("color_message_as", function()
local msg = net.ReadString()
if LocalPlayer():GetNWString("Admin_State") == "En service" then
chat.AddText(Color(255,255,255),"[",Color( 255, 0, 0 ), "NOTIFICATION", Color(255,255,255),"] "..msg)
end
end)
end
c'est un fichier que j'ai cree dans l'addons