29.10.2012, 20:35
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[256];
new File:file = fopen(str, io_read);
if(file)
{
new idx = 0;
while(fread(file, string))
{
sscanf(string,"s[MAX_PLAYER_NAME]s[6]", Contacts[playerid][idx], ContactsNum[playerid][idx]);
idx++;
}
}
fclose(file);
print("Contacts loaded successfully.");
return 1;
}
Any help?