15.06.2016, 10:14
1. At OnPlayerDisconnect and OnGameModeExit just use SavePlayer(i); instead of pasting the whole code.
2. Make a stock just like 'SavePlayer', but named 'ResetPlayer' - where you set all variables of the player to 0;
2.1 Have in mind you should use ResetPlayer(playerid); once a player registers and when they leave the server, so their stats wont mix up with other players once they join!
2.2 My example of "ResetPlayer":
3. Replace your INI_ParseFile with this one:
2. Make a stock just like 'SavePlayer', but named 'ResetPlayer' - where you set all variables of the player to 0;
2.1 Have in mind you should use ResetPlayer(playerid); once a player registers and when they leave the server, so their stats wont mix up with other players once they join!
2.2 My example of "ResetPlayer":
Code:
stock ResetPlayer(playerid) { PlayerInfo[playerid][pCash] = 0; PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pKills] = 0; PlayerInfo[playerid][pDeaths] = 0; PlayerInfo[playerid][pWantedLevel] = 0; PlayerInfo[playerid][pVip] = 0; PlayerInfo[playerid][pScore] = 0; PlayerInfo[playerid][pCondoms] = 0; //... add more here and ALWAYS use this AFTER SavePlayer(playerid); return 1; }
Code:
INI_ParseFile(UserPath(playerid), "LoadUser_user", .bExtra = true, .extra = playerid, .bPassTag = true);