INI system..
#1

Hello everyone, I am using INI as my character saving system, but I followed a tutorial and it didn't have everything I need.

I am using that:

pawn Code:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid, name[], value[]);
public LoadUser_data(playerid, name[], value[])
{
    INI_Int("Password", PlayerInfo[playerid][pPass]);
    INI_Int("Cash", PlayerInfo[playerid][pCash]);
    INI_Int("Admin", PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills", PlayerInfo[playerid][pKills]);
    INI_Int("Deaths", PlayerInfo[playerid][pDeaths]);
    return 1;
}


#define Path "/Users/%s.ini"
stock UserPath(playerid)
{
    new str[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(str,sizeof(str),Path,name);
    return str;
}

And I am willing to add guns to be saved, position and a skin.

I got no idea how to do that, can anyone explain that to me please?

2nd, is how to define that a player gets let's say 15k on his first spawn, and never again from spawning.
Because if I use GivePlayerMoney..that will just give him another 15k everytime he spawns...


Thanks ahead.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)