SA-MP Forums Archive
I Need A Limit Accounts Script - 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: I Need A Limit Accounts Script (/showthread.php?tid=358534)



I Need A Limit Accounts Script - RayBan - 10.07.2012

Hi, I Need A Script That You Can Not Make More Than 1 Account Per IP
Thankz


Re: I Need A Limit Accounts Script - Larceny - 10.07.2012

I thought doing it on two ways:

pawn Код:
//Put it in register function.
new pIP[18];
GetPlayerIp(playerid, pIP, sizeof(pIP));

new string[64];
new File:example = fopen("IPS.txt", io_read);
while(fread(example, string))
{
    if(strfind(string, pIP, true) != -1)
    {
        SendClientMessage(playerid, -1, "IP found");
        Kick(playerid);
    }
}
fclose(example);

//After registration:
new fPiP[32];
format(fPiP, sizeof(fPiP), "%s\r\n", pIP);
new File:log = fopen("IPS.txt", io_write);
if(log)
{
    fwrite(log, fPiP);
    fclose(log);
}
Or:

pawn Код:
//Put it in register function.
new pIP[18];
GetPlayerIp(playerid, pIP, sizeof(pIP));
if(fexist(pIP)){SendClientMessage(playerid, -1, "This ip is already registered."); Kick(playerid);}

//After registration
new pIP[18];
GetPlayerIp(playerid, pIP, sizeof(pIP));
new File:log = fopen(pIP, io_write);
fwrite(log, pIP);
fclose(log);
There's other ways to do it also...