Raised This Month: $ Target: $400
 0% 

[Help] Anti-Spam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bartu
New Member
Join Date: May 2014
Location: Argentina
Old 05-12-2014 , 13:42   [Help] Anti-Spam
Reply With Quote #1

Hello, good afternoon.
First of all I notice that I'm from Argentina and I'm using the google translator. I need help with my next plugin I'm doing (recently started to make plugins), making my plugin is to block spam say_team and SAY, ​​what I need is to block spam by NAME and not how. This plugin did watching tutorials and codes using different anti-spam plugins.

Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "Anti-Spam"
#define VERSION "2.0"
#define AUTHOR "Bartu"
 
stock const advertising_words[][] = {
 
 "Spam 1",
 "Spam 2",
 "Spam 3"

}
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 register_clcmd("say", "hook_chat");
 register_clcmd("say_team", "hook_chat");
}
 
public hook_chat(id)
{
 if((get_user_flags(id) & ADMIN_KICK))
    return 0;
 new szArgs[512];
 read_args(szArgs, 511);
 
 new len;
 len = strlen(szArgs);
 
 new digits, periods;
 
 new szName[32];
 get_user_name(id, szName, 31);
 
 for(new i = 0 ; i < sizeof (advertising_words) ; i++)
 {
  if(containi(szArgs, advertising_words[i]) != -1)
  {
       client_cmd(0, "spk ^"barney/soundsbad^"")
       client_print(0, print_chat, "<<Anti-Spam>>")
       client_print(0, print_chat, "TAG: %s", szName)
       client_print(0, print_chat, "CASTIGO: Baneado Permanente")
            server_cmd("amx_ban %s 99999 Spamero Puto", szName)
   return 1;
  }
 }
 
 for(new i; i < len; i++)
 {
  if(isdigit(szArgs[i]))
  {
   digits++
  }
  else if(szArgs[i] == '.' || szArgs[i] == ':')
  {
   periods++
  }
 }
 
 if(digits > 3 && periods > 2)
 {
       client_cmd(0, "spk ^"barney/soundsbad^"")
       client_print(0, print_chat, "<<Anti-Spam>>")
       client_print(0, print_chat, "TAG: %s", szName)
       client_print(0, print_chat, "CASTIGO: Baneado Permanente")
            server_cmd("amx_ban %s 99999 Spamero Puto", szName)
  return 1;
 }
 return 0;
}
__________________
Bartu is offline
Send a message via Skype™ to Bartu
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode