15.08.2018, 20:39
Hi I've making a Register & Login System It's working but after a players Reconnected all stats reset why? such as Admin level they will set his admin level from 5 to 0 why after reconnected?
This the code onplayerdisconnected
This the code onplayerdisconnected
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new file[200]; // We declare the size of the file
GetPlayerName(playerid,file,sizeof(file)); // We get the file name
format(file,sizeof(file),DOF2_File(file));// We get the user path from DOF2_File (folder Users)
DOF2_SetInt(file, "Kills",PlayerInfo[playerid][pKills]); // We set/update the players settings.
DOF2_SetInt(file, "Deaths",PlayerInfo[playerid][pDeaths]);
DOF2_SetInt(file, "Money",PlayerInfo[playerid][pMoney]);
DOF2_SetInt(file, "Score",PlayerInfo[playerid][pScore]);
DOF2_SetInt(file, "AdminLevel",PlayerInfo[playerid][pAdmin]);
DOF2_SetInt(file, "IP",PlayerInfo[playerid][pIP]);
DOF2_SetInt(file, "Hours",PlayerInfo[playerid][pHours]);
DOF2_SetInt(file, "Kidnaper",PlayerInfo[playerid][pKidnaper]);
DOF2_SetInt(file, "Hitman",PlayerInfo[playerid][pHitman]);
DOF2_SetInt(file, "Medic",PlayerInfo[playerid][pMedic]);
DOF2_SetInt(file, "GrabageMan",PlayerInfo[playerid][pGrabage]);
DOF2_SetInt(file, "ConArtist",PlayerInfo[playerid][pConArtist]);
DOF2_SetInt(file, "Mechanie",PlayerInfo[playerid][pMechanie]);
DOF2_SaveFile(); // Saves the file.