PHP Code:
#include <amxmodx>
public plugin_init( )
{
register_plugin( "Anti AutoBuy", AMXX_VERSION_STR, "SmileY" )
register_clcmd( "cl_setautobuy", "cmd_check" )
register_clcmd( "cl_setrebuy", "cmd_check" )
}
public cmd_check( id )
{
static arg[512], args, i
args = read_argc( )
for( i = 1; i < args; ++i )
{
read_argv( i, arg, charsmax( arg ) )
if( is_cmd_long( arg, charsmax( arg ) ) )
{
new SteamID[32]
get_user_authid(id,SteamID,31)
server_cmd("kick #%d ^"Banido permanentemente^"",get_user_userid(id))
server_cmd("amx_addban ^"%s^" 0 ^"Tentativa de derrubar o servidor.^"",SteamID)
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
stock bool:is_cmd_long( string[], const len )
{
static cmd[512]
while( strlen( string ) )
{
strtok( string, cmd, charsmax( cmd ), string, len , ' ', 1 )
if( strlen( cmd ) > 31 ) return true
}
return false
}
This is launched before your post in submissions.
__________________