30.04.2009, 14:57
Hai!
It's me again, I'm pretty annoying, I know.
Well, here's the problem. The following code compiles with no errors, but sometimes it doesn't save the stats.
It calls this function under OnPlayerDisconnect, and yes, it checks if the player is logged in.
It's me again, I'm pretty annoying, I know.
Well, here's the problem. The following code compiles with no errors, but sometimes it doesn't save the stats.
Код:
SavePlayer(playerid) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); dUserSetINT(pname[playerid]).("Password", AccountInfo[playerid][Password]); dUserSetINT(pname[playerid]).("AdminLevel", AccountInfo[playerid][AdminLevel]); dUserSetINT(pname[playerid]).("AntiVirus", AccountInfo[playerid][AntiVirus]); dUserSetINT(pname[playerid]).("Remote", AccountInfo[playerid][Remote]); dUserSetINT(pname[playerid]).("Radio", AccountInfo[playerid][Radio]); dUserSetINT(pname[playerid]).("Frequency", AccountInfo[playerid][Freq]); dUserSetINT(pname[playerid]).("Suit", AccountInfo[playerid][Suit]); dUserSetINT(pname[playerid]).("pFMember", AccountInfo[playerid][pFMember]); dUserSetINT(pname[playerid]).("pTeam", AccountInfo[playerid][pTeam]); dUserSetINT(pname[playerid]).("pRank", AccountInfo[playerid][pRank]); dUserSetINT(pname[playerid]).("pChar", AccountInfo[playerid][pChar]); dUserSetINT(pname[playerid]).("pMember", AccountInfo[playerid][pMember]); dUserSetINT(pname[playerid]).("pLeader", AccountInfo[playerid][pLeader]); dUserSetINT(pname[playerid]).("Experience", AccountInfo[playerid][Experience]); dUserSetINT(pname[playerid]).("VIPStatus", AccountInfo[playerid][VIPStatus]); dUserSetINT(pname[playerid]).("Warnings", AccountInfo[playerid][Warns]); dUserSetINT(pname[playerid]).("WarnReason1", AccountInfo[playerid][WarnReason1]); dUserSetINT(pname[playerid]).("WarnReason2", AccountInfo[playerid][WarnReason2]); dUserSetINT(pname[playerid]).("WarnReason3", AccountInfo[playerid][WarnReason3]); dUserSetINT(pname[playerid]).("TimesOnServer", (dUserINT(pname[playerid]).("TimesOnServer"))+1); AccountInfo[playerid][pFMember] = 0; AccountInfo[playerid][pTeam] = 0; AccountInfo[playerid][pRank] = 0; AccountInfo[playerid][pChar] = 0; AccountInfo[playerid][pMember] = 0; AccountInfo[playerid][pLeader] = 0; AccountInfo[playerid][Jailed] = 0; AccountInfo[playerid][AdminLevel] = 0; AccountInfo[playerid][AntiVirus] = 0; AccountInfo[playerid][Remote] = 0; AccountInfo[playerid][Radio] = 0; AccountInfo[playerid][Freq] = 0; AccountInfo[playerid][Suit] = 0; AccountInfo[playerid][Experience] = 0; AccountInfo[playerid][VIPStatus] = 0; AccountInfo[playerid][Warns] = 0; AccountInfo[playerid][Logged] = 0; AccountInfo[playerid][Mute] = 0; }