27.10.2009, 00:06
Fixed
new file[256]; new password[256]; password = dini_Get(file, "password");
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; }
Originally Posted by jamesb93
This isent saving the pass, it's retriving it.
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; } |
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]; file = dini_Get("scriptfiles/%.ini", password); 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; }
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]; file = "scriptfiles/%.ini"; 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; }
Originally Posted by darkrider366
Код:
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]; file = "scriptfiles/%.ini"; 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; } |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new playername[24], str[128];
GetPlayerName(playerid, playername, sizeof(playername));
format(str, sizeof(str), "%s.ini", playername);
if((dialogid == 1) && (response == 1))
{
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 password[256];
password = dini_Get(str, "password");
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;
}
if((dialogid == 2) && (response == 1))
{
new tmp[128];
new file[256];
new password[256];
password = dini_Get(file, "password"); // LINE - *
new pName[24]; // THIS LINE SHOULD GO AFTER THE LINE "new password[256];"
GetPlayerName(playerid, pName, sizeof(pName)); // THIS LINE SHOULD GO AFTER THE LINE "new password[256];"
format(file, sizeof(file), "%s.ini", pName); // THIS LINE SHOULD GO B E F O R E THE LINE I'VE MARKED AS *
//.......