Get player position at OnPlayerDisconnect..
#1

Is it me.. or it doens't get the player positions at on disconnect?

Becouse I have this:

pawn Код:
stock SaveStats(playerid)
{
    if(pInfo[playerid][Logged] != 0)
    {
        new Float: X, Float: Y, Float: Z;
        GetPlayerPos(playerid, X, Y, Z);
        djSetInt(strformat("Accounts/%s.ini", GetPName(playerid)), "Score", GetPlayerScore(playerid));
        djSetInt(strformat("Accounts/%s.ini", GetPName(playerid)), "Cash", GetPlayerMoney(playerid));
        djSetFloat(strformat("Accounts/%s.ini", GetPName(playerid)), "PosX", X);
        djSetFloat(strformat("Accounts/%s.ini", GetPName(playerid)), "PosY", Y);
        djSetFloat(strformat("Accounts/%s.ini", GetPName(playerid)), "PosZ", Z);
    }
    return 1;
}
And X, Y, Z keeps at default coords when you register..

Thanks.
Reply
#2

Not to sure. But maybe OnPlayerDisconnect is called after the character has disappeared. So you can't get coords that are no longer there. Just a theory.
Reply
#3

Ah, no.. I'm stupid.. I had a function before calling SaveStats that was wrong.. anyways, now works fine..

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)