I Need A Limit Accounts Script
#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


Messages In This Thread
I Need A Limit Accounts Script - by RayBan - 10.07.2012, 21:04
Re: I Need A Limit Accounts Script - by Larceny - 10.07.2012, 21:29

Forum Jump:


Users browsing this thread: 2 Guest(s)