30.10.2012, 05:49
After extreme debugging and raging and fapping, I seem to have found the answer:
pawn Код:
stock LoadContacts(playerid)
{
new str[MAX_PLAYER_NAME+20];
format(str, MAX_PLAYER_NAME+20, "/contacts/%s.ini",GetPlayerNameEx(playerid));
if(!fexist(str)) fcreate(str);
new string[MAX_PLAYER_NAME+8];
new File:file = fopen(str, io_read);
new idx = 0;
while(fread(file, string) && idx < 20)
{
sscanf(string,"s[MAX_PLAYER_NAME]s[6]", Contacts[playerid][idx], ContactsNum[playerid][idx]);
/*new strr[128];
format(strr,128, "Contact: %s , Number: %s, Location: %s", Contacts[playerid][idx], ContactsNum[playerid][idx], str);
print(strr);*/
idx++;
}
format(string, MAX_PLAYER_NAME+8, "");
format(str, MAX_PLAYER_NAME+20, "");
fclose(file);
// print("Contacts loaded successfully.");
return 1;
}

