1. You don't need a semicolon after preprocessors.
2. Indent your code proprely.
3. Check for player IP while is connecting.
Code:
#include <amxmodx>
#include <amxmisc>
#pragma semicolon 1
#define zIP "178.138.33.138"
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(equal(szIP, zIP) )
{
server_cmd( "kick #%d ^"Bye loser^"", get_user_userid( id ) );
}
//else // You don't need an 'esle' situation, cuz you're stopping the function.
return PLUGIN_HANDLED;
}
Your code is kicking all players, because...:
Code:
if( !task_exists( id + 1337 ) && !equal(szIP, "zIP") ) // Checking if the task don't exists and player's IP is not equal whit "zIP" ??? You defined zIP before, as constant, why you use it like a string?
{
set_task( 30.0, "task_NextPlayer", id + 1337 );
}
Code:
public task_NextPlayer( id )
{
id -= 1337; // If you remove task, then your condition from putinserver phase will be false
if( !is_user_connected( id ) )
return;
server_cmd( "kick #%d ^"Bye loser^"", get_user_userid( id ) );
}
__________________