Author Topic: FLOOD PROTECTION  (Read 701 times)

How do I trigger flood protection through code? I'm parenting the chat system for my Local chat, and I want to make it so if they spam, they trigger Flood protection like regular chat. I currently have:
Code: [Select]
//Flood protection stuff
         if(%client.lastChatText $= %text)
         {
         messageClient(%client,'',"\c5Do not repeat yourself.");
         if($Pref::Server::FloodProtectionEnabled && !%client.isAdmin && !%client.isSuperAdmin)
         {
         %client.spamMessageCount = 4;
         %client.spamMessageCount++;
         return;
            }
         }
         %client.lastChatText = %text;
I got most of this from SpaceGuy's code, but when I use his, it makes an endless loop of the person thats spamming talking, and it crashes me.