GMX not saving stats
#1

Hey guys, so I've a problem on GMXing my server.
So I made the command:

EDIT: Also, it spawns me into Blue Berry and spawns me under ground 2m down I guess? And then it kills me and then yeah, spawns me back onto the ground BUT still on Blue Berry?

pawn Код:
CMD:gmx(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337 || IsPlayerAdmin(playerid))
    {
        SetTimer("GameModeInitExitFunc", 29000, 0);
        SendClientMessageToAll(COLOR_LIGHTRED, "SERVER: A GMX has been intiaited by a admin, the GMX will occur in 30 seconds!");
        SendClientMessageToAll(COLOR_GRAD2, "  You have been frozen by the GMX system !");
        foreach(Player, i)
        {
            GMX[i] = 1;
            TogglePlayerControllable(i, 0);
            SaveAccountInfo(i);
        }
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
    }
    return 1;
}
Forwarded the timer.
pawn Код:
forward GameModeInitExitFunc();
public GameModeInitExitFunc()
{
    new string[128];
    format(string, sizeof(string), "Server Restarting...");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            DisablePlayerCheckpoint(i);
            GameTextForPlayer(i, string, 4000, 5);
            SetPlayerInterior(i, 0);
            SetPlayerVirtualWorld(i, 0);
            SetPlayerCameraPos(i,1460.0, -1324.0, 287.2);
            SetPlayerCameraLookAt(i,1374.5, -1291.1, 239.0);
            gPlayerLogged[i] = 0;
        }
    }
    SetTimer("GameModeExitFunc", 4000, 0);
    return 1;
}
Forwarded the other timer:
pawn Код:
forward GameModeExitFunc();
public GameModeExitFunc()
{
    GameModeExit();
}
And here's my SaveAccountInfo
pawn Код:
forward SaveAccountInfo(playerid);
public SaveAccountInfo(playerid)
{
    new INI:File = INI_Open(UserPath(playerid));
    new Float:X, Float:Y, Float:Z;
    new Float:facingangle;
    new Float:health, Float:armour;
    new skin = GetPlayerSkin(playerid);
    GetPlayerHealth(playerid, health);
    GetPlayerArmour(playerid, armour);
    GetPlayerFacingAngle(playerid, facingangle);
    GetPlayerPos(playerid, X, Y, Z);
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Level",GetPlayerScore(playerid));
    INI_WriteInt(File,"Int",GetPlayerInterior(playerid));
    INI_WriteInt(File,"Skin",skin);
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Number",PlayerInfo[playerid][pNumber]);
    INI_WriteInt(File,"ADMute",PlayerInfo[playerid][pADMute]);
    INI_WriteInt(File,"BankAccount",PlayerInfo[playerid][pBankAccount]);
    INI_WriteInt(File,"Accountdata",PlayerInfo[playerid][pAccountdata]);
    INI_WriteInt(File,"SecKey",PlayerInfo[playerid][pSecKey]);
    INI_WriteInt(File,"Helper",PlayerInfo[playerid][pHelper]);
    INI_WriteInt(File,"Stealthed",PlayerInfo[playerid][pStealthed]);
    INI_WriteInt(File,"DonateRank",PlayerInfo[playerid][pDonateRank]);
    INI_WriteInt(File,"NewbieMuted",PlayerInfo[playerid][pNewbieMuted]);
    INI_WriteFloat(File, "FacingAngle", facingangle);
    INI_WriteFloat(File, "Health", health);
    INI_WriteFloat(File, "Armour", armour);
    INI_WriteFloat(File, "LastX", X);
    INI_WriteFloat(File, "LastY", Y);
    INI_WriteFloat(File, "LastZ", Z);
    INI_Close(File);
    return 1;
}
But somehow, IT SAVES the STATS perfectly, working good when the Player Disconnects using /q or ESC all that. But somehow not the GMX command.
I used the same function as in OnPlayerDisconnect? SaveAccountInfo(playerid);
I'd like a possible and working solution, thanks!
Reply


Messages In This Thread
GMX not saving stats - by JustinAn - 01.12.2012, 19:38
Re: GMX not saving stats - by niels44 - 01.12.2012, 20:20
Re: GMX not saving stats - by JustinAn - 01.12.2012, 20:22
Re: GMX not saving stats - by JustinAn - 02.12.2012, 03:07
Re: GMX not saving stats - by Bakr - 02.12.2012, 03:36

Forum Jump:


Users browsing this thread: 1 Guest(s)