Hello, i have this plugin that kick a specific player after 10 seconds after connection, but sometimes the plugin kicks random people that don't have that ip can you help me fix it?
Code:
#include <amxmodx>
#include <amxmisc>
#define zIP "86.119.131.121"
new const
PLUGIN_NAME[ ] = "[Enduro]Autokick Enemy",
PLUGIN_VERSION[ ] = "1.1";
public plugin_init( )
{
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, "Rodney" );
// Add your code here...
}
public client_connect( id )
{
new szIP[40], players[32], num;
get_user_ip ( id, szIP, charsmax(szIP) , 1 ); // Get player's IP, without port.
if(equali(szIP, zIP) )
{
set_task( 10.0, "task_KickPlayer", id );
}
return PLUGIN_HANDLED;
}
public task_KickPlayer( id )
{
if( !is_user_connected( id ) )
return;
server_cmd( "kick #%d ^"[Enduro] Your ip is blacklisted^"", get_user_userid( id ) );
}