Replace the return with continue. You want to skip that comparison, not stop comparing
EDIT: I'll give it a shot later, when I get back on my PC
EDIT2:
Try this (untested)
PHP Code:
#include <amxmodx>
// Comment this line to disable the auto-kick on connect
#define AUTO_KICK_ON_CONNECT
public plugin_init()
{
register_plugin("Detect/Kick duplicate IPs", "1", "YamiKaitou");
register_clcmd("say ipcheck", "check_ip");
}
public check_ip(id)
{
new aPlayers[32], iCount, sIP1[16], sIP2[16], iPlayer, iTotal;
get_players(aPlayers, iCount, "ch");
get_user_ip(id, sIP1, charsmax(sIP1), 1);
for (new k = 0; k < iCount; k++)
{
iPlayer = aPlayers[k];
if (iPlayer == id)
continue;
get_user_ip(iPlayer, sIP2, charsmax(sIP2), 1);
if (equal(sIP1, sIP2))
iTotal++;
}
client_print(id, print_chat, "There are %d other player%s connected with your IP", iTotal, (iTotal==1) ? "" : "s");
return PLUGIN_CONTINUE;
}
#if defined AUTO_KICK_ON_CONNECT
public client_connect(id)
{
new aPlayers[32], iCount, sIP1[16], sIP2[16], iPlayer;
get_players(aPlayers, iCount, "ch");
get_user_ip(id, sIP1, charsmax(sIP1), 1);
for (new k = 0; k < iCount; k++)
{
iPlayer = aPlayers[k];
if (iPlayer == id)
continue;
get_user_ip(iPlayer, sIP2, charsmax(sIP2), 1);
if (equal(sIP1, sIP2))
{
server_cmd("kick #%d ^"Sorry, only one client per IP connected at a time^"", get_user_userid(id));
break;
}
}
}
#endif
__________________