27.10.2009, 12:25
This isent saving the pass, it's retriving it.
This is for the login dialog.
Whole OnDialgoResponce
This is for the login dialog.
Whole OnDialgoResponce
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if((dialogid == 1) && (response == 1)) { new playername[24], str[128]; GetPlayerName(playerid, playername, sizeof(playername)); format(str, sizeof(str), "%s.ini", playername); dini_Create(str); dini_Set(str,"password",inputtext); dini_IntSet(str,"Rank",PlayerInfo[playerid][pRank]); dini_IntSet(str,"Reborn=",PlayerInfo[playerid][pReborn]); dini_IntSet(str,"Exp", 0); dini_IntSet(str,"van", PlayerInfo[playerid][pVan]); dini_IntSet(str,"Kills", 0); dini_IntSet(str,"TKills", PlayerInfo[playerid][pTKills]); dini_IntSet(str,"GrenadeKills", 0); dini_IntSet(str,"Mp5Kills", 0); dini_IntSet(str,"KnuckleKills",0); dini_IntSet(str,"MenuGoal", 0); dini_IntSet(str,"HeliGoal", 0); dini_IntSet(str,"Armourgoal", PlayerInfo[playerid][pArmourgoal]); dini_IntSet(str,"Mapgoal", PlayerInfo[playerid][pMapgoal]); dini_IntSet(str,"Deaths", 0); dini_IntSet(str,"Admin", 0); dini_IntSet(str,"GM", 0); dini_IntSet(str,"Premium",0); dini_IntSet(str,"Money", PlayerInfo[playerid][pCash]); SendClientMessage(playerid, COLOR_WHITE, "Succesfully Registered!"); SendClientMessage(playerid, COLOR_WHITE, "Don't forget your password!."); OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]); return 1; } if((dialogid == 2) && (response == 1)) { new tmp[128]; new file[256]; new password[256]; password = dini_Get(file, "password"); new pName[24]; GetPlayerName(playerid, pName, sizeof(pName)); format(file, sizeof(file), "%s.ini", pName); new tmppass[64]; strmid(tmppass, tmp, 0, strlen(inputtext), 255); if(udb_hash(inputtext) == udb_hash(password)) { OnPlayerLogin(playerid,tmppass); } else { ShowPlayerDialog(playerid, 2,1,"Wrong Password", "That Password was not correct.\nPlease try again, or change your name.","Login","cancel"); } return 1; } if((dialogid == 2) && (response == 0)) { SendClientMessage(playerid, COLOR_RED, "You must log in to use this server"); Kick(playerid); } return 1; }