10.07.2012, 21:29
I thought doing it on two ways:
Or:
There's other ways to do it also...
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);
}
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);