Raised This Month: $ Target: $400
 0% 

Swear Banner for amxbans


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Trion
Junior Member
Join Date: Mar 2008
Old 08-05-2008 , 16:28   Swear Banner for amxbans
Reply With Quote #1

Hello, can sombady help to me?
i have code
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"
 
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")
 
readListg_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(filenameg_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 pos0
 
while ( g_swearsNum )
 {
 if ( (
pos containi(szSaid,g_swearsNames[i][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,00.050.5020.13.00.020.0210)         
         
show_hudmessage(id,"Ispejimas Uz Keiksmazodzius^n1 frag removed for next round!")
         return 
PLUGIN_HANDLED
 
}
  
set_hudmessage(220,80,00.050.5020.110.00.020.0210)        
  
show_hudmessage(id,"[Anti Keikunas]^nIspejimas Uz Keiksmazodzius!")
  
client_cmd(id"kill")
  } 

#endif       
 
return PLUGIN_CONTINUE 

and want, who swear 10 times will be banned for swearing
im use amxbans system commans "amx_ban "0" "nick" "swear""
__________________
Trion is offline
 



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 05:31.


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