03.10.2010, 02:09
This is my stock:
It's supose to give you an unique cell phone number, but when ever i use it, my server crashes. (it turnes off).
Please help, thank you.
pawn Код:
stock GiveCellNumber(playerid)
{
new number;
new string[128];
new Infinity = 0;
if(IsPlayerConnectedAndLoggedIn(playerid))
{
while(Infinity != 1)
{
number = random(899999) + 100000;
format(string, sizeof(string), "XRPG/Numbers/%s.ini",number);
if(!fexist(string)) // Check's if it's taken.
{
new File:hFile;
hFile = fopen(string, io_append);
fwrite(hFile, PlayerName[playerid]);
PlayerInfo[playerid][pMyNumber] = number;
fclose(hFile);
return 1; // Stops the loop. (i think :X).
}
}
}
return 1;
}
Please help, thank you.