Hello, i have a plugin that sould autokick a player with a certain ip every 30 seconds, but instead the plugin kicks everybody. can you help me please guys?
Code:
#include <amxmodx>
#include <amxmisc>
#pragma semicolon 1
#define zIP "178.138.33.138";
new const
PLUGIN_NAME[ ] = "Autokick enemy",
PLUGIN_VERSION[ ] = "1.0";
public plugin_init( )
{
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, "Barlap" );
// Add your code here...
}
public client_putinserver( id ){
new szIP[40];
get_user_ip ( id, szIP, charsmax(szIP) , 1 ); // Get player's IP
if( !task_exists( id + 1337 ) && !equal(szIP, "zIP") )
{
set_task( 30.0, "task_NextPlayer", id + 1337 );
}
else
return PLUGIN_HANDLED;
}
public task_NextPlayer( id )
{
id -= 1337;
if( !is_user_connected( id ) )
return;
server_cmd( "kick #%d ^"Bye loser^"", get_user_userid( id ) );
}