I Need A Limit Accounts Script
#1

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

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...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)