y_ini saving help
#1

Hello, I am trying to make it save when the player quits the game, here is what I have:

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new playname[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, playname, sizeof(playname));
    format(string, sizeof(string), "%s.ini", playname);
    if(fexist(string))
    {
        new playerName[MAX_PLAYER_NAME];
        new userfile[128];
        new Float:pHealth, Float:pArmour;
        GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
        format(userfile, sizeof(userfile), "%s.ini", playerName);
        new INI:file = INI_Open(userfile);
        INI_SetTag(file, "Player Stats");
        INI_WriteInt(file, "Level", GetPlayerScore(playerid));
        INI_WriteInt(file, "Money", GetPlayerMoney(playerid));
        INI_WriteInt(file, "Health", GetPlayerHealth(playerid, pHealth));
        INI_WriteInt(file, "Armour", GetPlayerArmour(playerid, pArmour));
        INI_WriteInt(file, "Skin", GetPlayerSkin(playerid));
        INI_Close(file);
        return 1;
    }
    return 1;
}
Why isn't it saving the file? When I go to the scriptfiles folder, the playerfile is not there.
Reply


Messages In This Thread
y_ini saving help - by Tommy_Mandaz - 18.04.2011, 00:51
Re: y_ini saving help - by AK47317 - 18.04.2011, 01:11
Re: y_ini saving help - by Tommy_Mandaz - 18.04.2011, 01:17
Re: y_ini saving help - by AK47317 - 18.04.2011, 01:26
Re: y_ini saving help - by Tommy_Mandaz - 18.04.2011, 01:43
Re: y_ini saving help - by AK47317 - 18.04.2011, 01:45
Re: y_ini saving help - by Tommy_Mandaz - 18.04.2011, 01:52
Re: y_ini saving help - by AK47317 - 18.04.2011, 01:56
Re: y_ini saving help - by Tommy_Mandaz - 18.04.2011, 02:08
Re: y_ini saving help - by AK47317 - 18.04.2011, 02:19

Forum Jump:


Users browsing this thread: 1 Guest(s)