• Custom chat commands not working
    2 replies, posted
[B][U]These worked previously but now they do not seem to work, i cant spot any problem, can you help?[/U][/B] [CODE] local function AdminAdvertise(ply, args) if args == "" then return "" end local DoSay = function(text) if text == "" then return end if ply:IsAdmin() then for k,v in pairs(player.GetAll()) do local col = team.GetColor(ply:Team()) GAMEMODE:TalkToPerson(v, col, LANGUAGE.aadvert .." "..ply:Nick(), Color(255,0,0,255), text, ply) end end end return args, DoSay end AddChatCommand("/aadvert", AdminAdvertise, 1.5) local function PlayerReport(ply, args) print(ply:Name().." has tried to report something") local numadmins = 0 for _, v in pairs(player.GetAll()) do if v:IsAdmin() or v:GetUserGroup() == "moderator" then numadmins = numadmins + 1 end end if numadmins == 0 then ply:ChatPrint("Sorry, there are no admins online. Please make a ticket on the helpdesk at ____________________") else local rmsg = args msg = string.sub( msg, 7, string.len( msg ) ) for i=1,string.len( msg ) do msg = string.Trim( msg ) end if ( string.len( msg ) < 1 or msg == "" ) then ply:ChatPrint( "You need to enter a message of at least 2 characters!" ) return "" end for _, v in pairs(player.GetAll()) do if v:IsAdmin() then v:ChatPrint("[Report] "..ply:Name()..": "..rmsg) end end ply:ChatPrint("Thanks for reporting this. There are "..numadmins.." online to assist you. Here's what you told them:") ply:ChatPrint(rmsg) return "" end end AddChatComman("/admin",PlayerReport, 1.5) local function SAdvertise(ply, args) if args == "" then return "" end local DoSay = function(text) if text == "" then return end if ply:GetUserGroup() == "root_admin" or ply:GetUserGroup() == "owner" then for k,v in pairs(player.GetAll()) do local col = team.GetColor(ply:Team()) GAMEMODE:TalkToPerson(v, col, "[ServerAdvert] "..ply:Nick(), Color(255,69,0,255), text, ply) end end end return args, DoSay end AddChatCommand("/sadvert", SAdvertise, 1.5) local function NewAdminChat(ply, args) if args == "" then return "" end local DoSay = function(text) if text == "" then return end if ply:IsAdmin() then for k,v in pairs(player.GetAll()) do local col = team.GetColor(ply:Team()) if v:IsAdmin() then GAMEMODE:TalkToPerson(v, col,"(Admin Chat) "..ply:Nick(), Color(127,0,255,255), text, ply) end end end end return args, DoSay end AddChatCommand("/ac", NewAdminChat, 1.5)[/CODE]
Your /admin chat add is missing a d. Try fixing that
that didnt end up working, anyone else know anything that can help?
Sorry, you need to Log In to post a reply to this thread.