- Home /
Question by
johnleonhart · Apr 27, 2017 at 01:05 PM ·
chatspam
How to auto banned who send spam chat, my code not work HELP
hi! I need help,, My code not work,, I want to autoban who send spam chat with loop code , here is my code
[RPC]
private void Chat(string content, string sender, PhotonMessageInfo info)
{
PhotonPlayer sender2 = info.sender;
lastChatTime = Time.time;
this.chatSpamCounter = 0;
lastChatSender = info.sender.ID;
if (info.sender.ID == this.lastChatSender)
{
if ((double) Time.time - (double) lastChatTime < 0.10000124340)
{
GameManager gameManager = this;
int num1 = fengGameManagerMkii.chatSpamCounter + 1;
fengGameManagerMkii.chatSpamCounter = num1;
if (num1 > 4)
{
FengGameManagerMKII.instance.kickPlayer(sender2, true, "");
MyConsole.ConsoleMessages.Add(" Alert!!! Player : " + sender2 + "is Trying To spam Chat");
}
}
}
if (sender != string.Empty)
{
content = sender + ":" + content;
}
content = "<color=#FFC000>[" + Convert.ToString(info.sender.ID) + "]</color> " + content;
this.chatRoom.addLINE(content);
}
the problem is, " if (num > 4) " Why Not work? ,,, Pls help
Comment