20.03.2016, 20:52
Код:
enum pInfo { pPass, pLevel, pExperience, pMaxExperience, pSexe, pAge, pOrigine, pBanned, pArgentBanque, pArgentPoche, pSkin, pFonction, pAdminstrator, pRegistred, Float: pExtX, Float: pExtY, Float: pExtZ, } new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Inscription",""COL_RED"Le mot de passe que vous avez choisi est incorrect\n"COL_WHITE"Tapez votre mot de passe si dessus pour pouvoir s'inscrir.","Inscription","Quitter"); new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File, "Password", udb_hash(inputtext)); INI_WriteInt(File,"Admin",0); INI_WriteInt(File,"Level",0); INI_WriteInt(File,"PE", 0); INI_WriteInt(File,"MPE",0); INI_WriteInt(File,"ArgentBanque", 0); INI_WriteInt(File,"ArgentPoche", 0); INI_WriteInt(File,"Sexe", 0); INI_WriteInt(File,"Age", 0); INI_WriteInt(File,"Origine", 0); INI_WriteInt(File,"Ban", 0); INI_WriteInt(File,"Skin",0); INI_WriteInt(File,"Fonction",0); INI_WriteInt(File,"Engistré",0); INI_WriteFloat(File,"ExtX",0.0000); INI_WriteFloat(File,"ExtY",0.0000); INI_WriteFloat(File,"ExtZ",0.0000); INI_Close(File); ShowPlayerDialog(playerid, DIALOG_SEXE, DIALOG_STYLE_MSGBOX, ""COL_WHITE"Choix Sexe", ""COL_YELLOW"Choisissez le sexe de votre personnage.", "Homme", "Femme"); } }
Код:
public OnPlayerDisconnect(playerid, reason) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); PlayerInfo[playerid][pExtX] = X; PlayerInfo[playerid][pExtY] = Y; PlayerInfo[playerid][pExtZ] = Z; new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]); INI_WriteInt(File,"PE",PlayerInfo[playerid][pExperience]); INI_WriteInt(File,"MPE",PlayerInfo[playerid][pMaxExperience]); INI_WriteInt(File,"ArgentBanque",PlayerInfo[playerid][pArgentBanque]); INI_WriteInt(File,"ArgentPoche",PlayerInfo[playerid][pArgentPoche]); INI_WriteInt(File,"Sexe",PlayerInfo[playerid][pSexe]); INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]); INI_WriteInt(File,"Origine",PlayerInfo[playerid][pOrigine]); INI_WriteInt(File,"Ban",PlayerInfo[playerid][pBanned]); INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]); INI_WriteInt(File,"Fonction",PlayerInfo[playerid][pFonction]); INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdminstrator]); INI_WriteInt(File,"Engistré",PlayerInfo[playerid][pRegistred]); INI_WriteFloat(File,"ExtX",X); INI_WriteFloat(File,"ExtY",Y); INI_WriteFloat(File,"ExtZ",Z); INI_Close(File); return 1; }
Код:
forward LoadUser_data(playerid,name[],value[]); public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Level",PlayerInfo[playerid][pLevel]); INI_Int("PE",PlayerInfo[playerid][pExperience]); INI_Int("MPE",PlayerInfo[playerid][pMaxExperience]); INI_Int("ArgentBanque",PlayerInfo[playerid][pArgentBanque]); INI_Int("ArgentPoche",PlayerInfo[playerid][pArgentPoche]); INI_Int("Sexe",PlayerInfo[playerid][pSexe]); INI_Int("Age",PlayerInfo[playerid][pAge]); INI_Int("Origine",PlayerInfo[playerid][pOrigine]); INI_Int("Ban",PlayerInfo[playerid][pBanned]); INI_Int("Skin",PlayerInfo[playerid][pSkin]); INI_Int("Fonction",PlayerInfo[playerid][pFonction]); INI_Int("Admin",PlayerInfo[playerid][pAdminstrator]); INI_Int("Engistré",PlayerInfo[playerid][pRegistred]); INI_Float("ExtX",PlayerInfo[playerid][pExtX]); INI_Float("ExtY",PlayerInfo[playerid][pExtY]); INI_Float("ExtZ",PlayerInfo[playerid][pExtZ]); return 1; } But at 70/100 this happens when i edit my admin grade in the file didn't test to edit another thingКод:[data] Password = 257360544 Admin = 9999 Level = 1 PE = 0 MPE = 3 ArgentBanque = 4500 ArgentPoche = 3500 Sexe = 1 Age = 21 Origine = 2 Ban = 0 Skin = 60 Fonction = 0 Engistré = 1 ExtX = 1724.363769 ExtY = -1855.355957 ExtZ = 13.414062 [data] Level = 1 PE = 0 MPE = 3 ArgentBanque = 4500 ArgentPoche = 3500 Sexe = 1 Age = 21 Origine = 2 Ban = 0 Skin = 60 Fonction = 0 Admin = 9999 Engistré = 1 ExtX = 1738.516723 ExtY = -1855.158935 ExtZ = 13.414062