09.11.2015, 19:33
Hello. How to make a command that detects players who connect from same IP (tell the name of the accounts who connect from the same IP)?
CMD:ip(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(isnull(params))
return SendClientMessage(playerid, -1, "USAGE: /ip [IP]");
new pIP[32], playerIP[32], string[32];
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerIp(playerid, playerIP, sizeof playerIP);
if(!strcmp(pIP, playerIP))
{
format(string, sizeof string, "%s, %d", string, playerid);
}
}
SendClientMessage(playerid, -1, string);
}
return 1;
}