• DarkRP PlayerSay/PostPlayerSay
    2 replies, posted
Hi, How can I hide a certain chat in DarkRP? Using PlayerSay and returning false doesn't work, and neither does it work in PostPlayerSay. How do I hide a certain chat in DarkRP? Here is a snippet of my code: [CODE]hook.Add("PlayerSay","groups_menu_chat",function(ply,msg2,team) local msg = string.lower(msg2) if msg == "!group" and team == false then openGroups(ply) return false end if msg == "!accept" and team == false and ply.GroupInvited ~= nil then groups[ply.GroupInvited][3][ply] = {["Role"]="Member",["Player"]=ply} coroutine.resume(coroutine.create(startHandleOfGroup),ply:SteamID(),ply.GroupInvited,groups[ply.GroupInvited][1]) for _,v in pairs(groups[ply.GroupInvited][3]) do net.Start("refresh_playerlist") net.Send(v["Player"]) end ply:SendLua('chat.AddText(Color(0,0,255),"[RealRoleplay Groups] ",Color(0,255,0),"Accepted group invite to the group ",Color(255,240,0),"'..ply.GroupInvited..'")') ply.GroupInvited = nil return false end if msg == "!decline" and team == false and ply.GroupInvited ~= nil then ply:SendLua('Color(0,0,255),"[RealRoleplay Groups] ",Color(255,0,0),"Declined group invite to the group ",Color(0,255,0),ply.GroupInvited') ply.GroupInvited = nil return false end if string.sub(msg,1,4) == "/gm " or string.sub(msg,1,4) == "!gm " and team == false then local donesomething = false for i,v in pairs(groups) do if v[3][ply] ~= nil then donesomething = true for _,v in pairs(v[3]) do v["Player"]:SendLua('chat.AddText(Color(0,0,255),"['..i..'] ",Color(0,255,0),"From '..ply:Nick()..': ",Color(255,0,0),"'..string.sub(msg2,5)..'")') end end end if donesomething == false then ply:SendLua('chat.AddText(Color(0,0,255),"[RealRoleplay Groups] ",Color(255,0,0),"You\'re not in a group yet!")') end return false end end)[/CODE]
return ""
Thanks :)
Sorry, you need to Log In to post a reply to this thread.