Loading Error
#5

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;
}
Reply


Messages In This Thread
Loading Error - by maramizo - 29.10.2012, 19:59
Re: Loading Error - by maramizo - 29.10.2012, 20:35
Re: Loading Error - by maramizo - 29.10.2012, 21:20
Re: Loading Error - by maramizo - 30.10.2012, 04:36
Re: Loading Error - by maramizo - 30.10.2012, 05:49

Forum Jump:


Users browsing this thread: 1 Guest(s)