Re: Swear Banner for amxbans
Here you go mate ;)
PHP Code:
#include <amxmodx> #include <fun> // max number of words in word list #define MAX_WORDS 4096 // file to read words from new g_swearsFile[] = "addons/amxmodx/wordlist.cfg" // Set here to 1 and recompile if you want to punish // player with -10 health #define PUNISH_PLAYER 1 #define alive 1 new g_swearsNames[MAX_WORDS][32] new g_swearsNum public plugin_init() { register_plugin("Anti Keikunas","6.9","Trion/Iwon") register_clcmd("say","swearPunish") register_clcmd("say_team","swearPunish") register_cvar("sw_mode","1") register_cvar("sw_slap","50.0") register_cvar("sw_admin","25.0") readList( g_swearsFile ) return PLUGIN_CONTINUE } readList(filename[]) { if(!file_exists(filename) ){ log_message("Swear Filter: file %s not found", filename) return } new iLen while( g_swearsNum < MAX_WORDS && read_file(filename, g_swearsNum ,g_swearsNames[g_swearsNum][1],30,iLen) ) { g_swearsNames[g_swearsNum][0] = iLen ++g_swearsNum } log_message("Swear Filter: loaded %d words",g_swearsNum ) } #if PUNISH_PLAYER == 1 public plugin_precache() { precache_sound( "ambience/thunder_clap.wav") return PLUGIN_CONTINUE } #endif public swearPunish(id) { new szSaid[192] read_args(szSaid,191) new bool:found = false new pos, i = 0 while ( i < g_swearsNum ) { if ( (pos = containi(szSaid,g_swearsNames[i][1])) != -1 ){ new len = g_swearsNames[i][0] while(len--) szSaid[pos++] = '*' found = true continue } ++i } if ( found ){ new cmd[32] read_argv(0,cmd,31) if(get_cvar_num("sw_admin") == 1){ if (get_user_flags(id)&ADMIN_IMMUNITY){ return PLUGIN_HANDLED } } engclient_cmd(id,cmd,szSaid) #if PUNISH_PLAYER == 1 if(is_user_alive(id) == 1){ if(get_cvar_num("sw_mode") == 0){ new pfrags = get_user_frags(id) set_user_frags(id,pfrags -1) set_hudmessage(220,80,0, 0.05, 0.50, 2, 0.1, 3.0, 0.02, 0.02, 10) show_hudmessage(id,"Your swearing is badd and^n1 frag removed for next round!") return PLUGIN_HANDLED } set_hudmessage(220,80,0, 0.05, 0.50, 2, 0.1, 10.0, 0.02, 0.02, 10) show_hudmessage(id,"[Anti Swear]^nYou have Sweared to much and ban!") set_task(1.0, "Banz", 0, "", 0, "b") //client_cmd(id, "kill") } } #endif return PLUGIN_CONTINUE }
public Banz(id) { new szSaid[192] read_args(szSaid,191) server_cmd("amx_ban %s^n0^nReason: You have swore to much(Permently Banned)", szSaid) }
Changed here you go.
|