Saving
#1

When a player registers, it inserts their data into the database, as it should. However, when they log out, the database does not update. The weird thing is, I know its not my queries, because if I log back in, everything DOES save from then on. Just the first time an account is created. I'm assuming it has to do with my register function.

pawn Код:
public OnPlayerRegister(playerid)
{
    pInfo[playerid][Level] = 1;
    pInfo[playerid][Admin] = 0;
    pInfo[playerid][Skin] = 1;
    pInfo[playerid][Cash] = 5000; //These vars do not save the first time.

    GivePlayerMoney(playerid, 5000);
   
    SpawnPlayer(playerid);

    SetPlayerSkin(playerid, 1);


    return 1;
}
Reply
#2

Well, maybe there's something like 'if(IsPlayerLoggedIn(playerid))' before the logout function, and the variable that stores the logged-in state isn't equal to TRUE, so the logout function isn't being called.
Reply
#3

Quote:
Originally Posted by paulommu
Посмотреть сообщение
Well, maybe there's something like 'if(IsPlayerLoggedIn(playerid))' before the logout function, and the variable that stores the logged-in state isn't equal to TRUE, so the logout function isn't being called.
No, there is not.
Reply
#4

pawn Код:
public OnPlayerRegister(playerid)
{
    pInfo[playerid][Level] = 1;
    pInfo[playerid][Admin] = 0;
    pInfo[playerid][Skin] = 1;
    pInfo[playerid][Cash] = 5000; //These vars do not save the first time.

    GivePlayerMoney(playerid, 5000);
   
    SpawnPlayer(playerid);

    SetPlayerSkin(playerid, 1);


    return 1;
}
Where are you saving these?
Reply
#5

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
pawn Код:
public OnPlayerRegister(playerid)
{
    pInfo[playerid][Level] = 1;
    pInfo[playerid][Admin] = 0;
    pInfo[playerid][Skin] = 1;
    pInfo[playerid][Cash] = 5000; //These vars do not save the first time.

    GivePlayerMoney(playerid, 5000);
   
    SpawnPlayer(playerid);

    SetPlayerSkin(playerid, 1);


    return 1;
}
Where are you saving these?
Under OnPlayerDisconnect, and every 5 minutes (incase of server crash)

I tried adding the SavePlayer() function there, but it did not make a difference.
Reply
#6

I hate to bump this but it's really bugging me :S
Reply
#7

Still looking for a resolution to this issue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)