• Evolve chat tags
    7 replies, posted
Hi i was wondering how to make evovle chat tags i cant seem to get them to work. thanks
[b][url=http://wiki.garrysmod.com/?title=Chat.AddText]Chat.AddText [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Example: [lua]chat.AddText(Color(0,0,0),"[EVOLVE]", Color(255,0,0),"Player"..v:Nick().."has been banned!")[/lua] [b]should[/b] make it print [EVOLVE] (in black text) Player (player name) has been banned! (in green text)
I think he means like [quote](Super Admin) Name: I'm a super admin[/quote][code] hook.Add("PlayerSay","AdminTag",function(ply, text, team) if(ply:IsAdmin() and !ply:IsSuperAdmin()) then return "(Admin) "..ply:Nick()..": "..text; end end [/code]
[QUOTE=devinpro;25664518]I think he means like [code] hook.Add("PlayerSay","AdminTag",function(ply, text, team) if(ply:IsAdmin() and !ply:IsSuperAdmin()) then return "(Admin) "..ply:Nick()..": "..text; end end [/code][/QUOTE] That wouldn't work if I'm not mistaken, it would print: Carmine:(Admin) Carmine: test you have to use Chat.AddText() like c-unit said.
[lua]if (SERVER) then AddCSLuaFile("autorun/tags.lua") else function Insert( pl, msg ) local tab = {} if pl:EV_IsSuperAdmin() then table.insert( tab, Color( 255, 0, 0, 255 ) ) table.insert( tab, "(Admin) " ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, pl ) table.insert( tab, ": " ) table.insert( tab, msg ) elseif pl:EV_IsAdmin() then table.insert( tab, Color( 0, 35, 175, 255 ) ) table.insert( tab, "(Mod) " ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, pl ) table.insert( tab, ": " ) table.insert( tab, msg ) else table.insert( tab, Color( 0, 185, 35, 255 ) ) table.insert( tab, "(Guest) " ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, pl ) table.insert( tab, ": " ) table.insert( tab, msg ) end table.insert( tab, Color( 125, 125, 125, 255 ) ) chat.AddText( unpack(tab) ) return true end end end hook.Add("OnPlayerChat", "InsertTags", Insert)[/lua]
[QUOTE=Jova;25680052][lua]if (SERVER) then AddCSLuaFile("autorun/tags.lua") else function Insert( pl, msg ) local tab = {} if pl:EV_IsSuperAdmin() then table.insert( tab, Color( 255, 0, 0, 255 ) ) table.insert( tab, "(Admin) " ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, pl ) table.insert( tab, ": " ) table.insert( tab, msg ) elseif pl:EV_IsAdmin() then table.insert( tab, Color( 0, 35, 175, 255 ) ) table.insert( tab, "(Mod) " ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, pl ) table.insert( tab, ": " ) table.insert( tab, msg ) else table.insert( tab, Color( 0, 185, 35, 255 ) ) table.insert( tab, "(Guest) " ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, pl ) table.insert( tab, ": " ) table.insert( tab, msg ) end table.insert( tab, Color( 125, 125, 125, 255 ) ) table.insert( tab, os.date( " | %a, %I:" ) ) table.insert( tab, os.date( "%M:" ) ) table.insert( tab, os.date( "%S %p" ) ) chat.AddText( unpack(tab) ) return true end end end hook.Add("OnPlayerChat", "InsertTags", Insert)[/lua][/QUOTE] I love you times infinity <3 :D
remove the os.date things
Sorry, you need to Log In to post a reply to this thread.