Y_INI INI_Int loop
#1

Hey, is it possible to run a loop like this (below), or similar to load information from .ini file? I tryed to run it arleady, but it didn't worked, what should I do?

pawn Код:
#define MAX_SKINS 200
new CID[MAX_PLAYERS][MAX_SKINS];
new SID[MAX_PLAYERS];

stock SaveData(playerid)
{
    new pini[32];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(pini, sizeof(pini), "Users/%s.ini", playername);
    new INI:File = INI_Open(pini);

    new id = SID[playerid];
    new msg[10];
    format(msg, sizeof(msg), "Skin_%i", id);
   
    INI_SetTag(File, "clothes");
    INI_WriteInt(File, "ID", SID[playerid]);
    INI_WriteInt(File, msg, GetPlayerSkin(playerid));
    INI_Close(File);
    return 1;
}

public LoadUser_clothes(playerid, name[], value[])
{
    INI_Int("ID", SID[playerid]);

    for(new i=0; i<MAX_SKINS; i++)
    {
        new msg[10];
        format(msg, sizeof(msg), "Skin_%i", i);
        INI_Int(msg, CID[playerid][i]);
    }
    return 1;
}
Reply
#2

Any ideas?
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
You should be able to, but I'm confused as to why you are doing it this way.
What do you mean?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)