- 0
Problema login
-
Similar Content
-
- 11 replies
- 378 views
-
- 3 answers
- 791 views
-
- 2 answers
- 430 views
-
Problema turf
By Soryn.,
- 3 answers
- 340 views
-
- 2 replies
- 123 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
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
Link to comment
Share on other sites
3 answers to this question
Recommended Posts