SA-MP Forums Archive
Help Please About Ip - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Please About Ip (/showthread.php?tid=309397)



Help Please About Ip - xinix000 - 07.01.2012

How to detect that player that have same ip and login together 5 player will be ban automatic ??


Re: Help Please About Ip - xinix000 - 07.01.2012

pawn Код:
forward CheckDuplicateIp();
public CheckDuplicateIp()
{
    new ip[16];
    new count[32];
    new string[256];
    for(new i = 0; i<MAX_PLAYERS;i++)
    {
        GetPlayerIp(i, ip, 16);
        count[ip]++; // ERROR
        if(count[ip] >= 5) // ERROR
        {
            format(string,sizeof(string),"banip %s",ip);
            SendRconCommand(string);
            SendRconCommand("reloadbans");
        }
    }
    return 1;
}
it show error

pawn Код:
error 033: array must be indexed (variable "ip")



Re: Help Please About Ip - Psymetrix - 07.01.2012

Check your filterscripts folder that came with the server package. There is this exact code. It's named "maxips.pwn".


Re: Help Please About Ip - xinix000 - 07.01.2012

Oh thank you