- 0
Problema login
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
Iulian
Salut! Recent m-am apucat sa creez un gamemode de la 0, iar la sistemul de login am dat de o problema care imi da batai de cap.
Problema consta in: eu cand ma inregistrez imi pun parola "parola" (spre exemplu). Toate bune si frumoase, parola se salveaza in fisierul utilizatorului, dar cand vreau sa ma loghez, daca pun o alta parola, spre exemplu "sanandreas" ma conecteaza, chiar daca parolele nu corespund.
DIALOG LOGIN:
[pawn] if(dialogid == DIALOG_LOGIN)
{
if(!response)
{
Kick(playerid);
}
else
{
new name[64],file[128], pas[64];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "Utilizatori/%s.ini", name);
format(pas, sizeof(pas), "%s", dini_Int(file, "Parola"));
if(strcmp(inputtext, pas, false) == 0)
{
LoadUser(playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Parola incorecta!");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Logare", "Introdu parola mai jos pentru a te loga", "Logare", "Anulare");
}
}
return 1;
}[/pawn]
LoadUser:
[pawn]forward LoadUser(playerid);
public LoadUser(playerid)
{
new name[64], file[64];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "Utilizatori/%s.ini", name);
PlayerInfo[playerid][pLogged] = 1;
PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
PlayerInfo[playerid][pPassword] = dini_Int(file, "Parola");
return 1;
}[/pawn]
Rate me
3 answers to this question
Recommended Posts