if(dialogid == 1) {
new file[128], name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(file, sizeof(file), "LATDM/users/%s.ini", name);
if(response) {
if(strlen(inputtext)) {
dini_Create(file);
dini_IntSet(file, "pw", num_hash(inputtext));
dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
dini_IntSet(file, "VipLevel", PlayerInfo[playerid][VipLevel]);
dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
dini_IntSet(file, "score", PlayerInfo[playerid][score]);
format(str, sizeof(str), "You are registered as ~r~ %s. Your password is ~r~ %s. /changepass to change it", name, inputtext);
SendClientMessage(playerid, -1, str);
PlayerInfo[playerid][score] = dini_Int(file, "score");
PlayerInfo[playerid][cash] = dini_Int(file, "cash");
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
PlayerInfo[playerid][VipLevel] = dini_Int(file, "VipLevel");
}
}
else {
Kick(playerid);
}
}
if(dialogid == 2) {
new file[128], name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "LATDM/users/%s.ini", name);
if(response) {
if(strlen(inputtext)) {
if(num_hash(inputtext) != dini_Int(file, "pw")) {
SendClientMessage(playerid, COLOR_RED, "[Anti-Cheat]: you have typed a wrong password for this account !");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
}
else {
format(str, sizeof(str), "welcome %s ! you are now logged-in to your account .", name);
PlayerInfo[playerid][score] = dini_Int(file, "score");
PlayerInfo[playerid][cash] = dini_Int(file, "cash");
GivePlayerMoney(playerid, dini_Int(file, "cash"));
SetPlayerScore(playerid, dini_Int(file, "score"));
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
PlayerInfo[playerid][VipLevel] = dini_Int(file, "VipLevel");
}
}
}
else {
Kick(playerid);
}
}
dini_IntSet(file, "pw", num_hash(inputtext));
dini_IntSet(file, "pw", strval(inputtext));
if(num_hash(inputtext) != dini_Int(file, "pw")) {
if(strval(inputtext) != dini_Int(file, "pw")) {
try changing
pawn Код:
pawn Код:
and for dialog 2 change pawn Код:
pawn Код:
|