This is my fast edit :
Code:
#include <amxmodx>
#include <amxmisc>
#define skipOthers(%0) ( is_user_bot(%0) || is_user_hltv(%0) || is_user_admin(%0) )
/* Equal is the same as cotain so it could be like this also
( contain( string , %0 ) != 0x01) ...
*/
#define isEqual(%0) contain( string , %0 ) // remember that its declare by the name of string
public plugin_init()
{
register_plugin( "Anti ..." , "0.1" , "Freezo" )
register_clcmd( "say" , "hookSay")
register_clcmd( "say_team" , "hookSay")
}
public client_infochanged( id ) {
if ( skipOthers(id) ) return 1
if (_IsValid( getUsername(id) ) ) server_cmd ("kick #%d Disallowed nickname!" , get_user_userid(id) )
return 0
}
public client_putinserver( id ){
if( skipOthers(id) ) return 1
if (_IsValid( getUsername(id) ) ) server_cmd ("kick #%d Disallowed nickname!" , get_user_userid(id) )
set_task ( 20.0 , "showWarnings" , id )
return 0
}
public hookSay( id ){
new args[ 168 ]
read_args( args , charsmax(args) )
if( _IsValid( args ) ) return 1
return 0
}
public showWarnings( id ) client_print ( id , print_chat , "Advertising other servers or websites is strictly prohibited!")
stock bool:_IsValid( const string[] ) {
for (new i = 0; string[i] ; i++ ){
if ( ('0' <= string[i] <= '9') && ( spaceCheck( string ) || ~isEqual(".") || ~isEqual(",") || ~isEqual("-") ) ){
return true
}
}
return false
}
stock bool:spaceCheck ( const string[] ){
new a
while ( a < strlen ( string ) ){
if (string[a++] == ' ') return true
}
return false
}
stock getUsername( index ){
new szName[32]
get_user_name ( index , szName , charsmax ( szName ))
return szName
}