13.11.2014, 14:35
My registration system use dini save system and i have one problem with user password's.
When player create account and type password that inputtext is going to num_hash,and save to pInfo.
But i don't wanna make that,i want when player typed password save that password to pInfo.
I try make without hashing code but not work,its only password=0..
I will put some codes:
Onplayerregister
Onplayerconnect
And i have dialogs for registration under OnPlayerRequestClass
I will give rep + who help me to fix this
When player create account and type password that inputtext is going to num_hash,and save to pInfo.
But i don't wanna make that,i want when player typed password save that password to pInfo.
I try make without hashing code but not work,its only password=0..
I will put some codes:
Onplayerregister
Код:
public OnPlayerRegister(playerid, password[]) { if(IsPlayerConnected(playerid)) { new string3[64]; new string[128]; new playersip[24]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); GetPlayerIp(playerid, playersip, sizeof(playersip)); format(string3, sizeof(string3), "UER X2/Users/%s.ini", playername3); dini_Create(string3); new password2 = num_hash(password); PlayerInfo[playerid][pKey] = password2; dini_IntSet(string3, "Password",password2);
Код:
public OnPlayerLogin(playerid,password[]) { new tmp2[256] new string2[64]; new string[128]; new playername2[MAX_PLAYER_NAME]; new playersip[24]; GetPlayerName(playerid, playername2, sizeof(playername2)); GetPlayerIp(playerid, playersip, sizeof(playersip)); format(string2, sizeof(string2), "UER X2/Users/%s.ini", playername2); if(dini_Exists(string2)) { new password2 = num_hash(password); if(dini_Int(string2,"Password") == PlayerInfo[playerid][pKey]) { PlayerInfo[playerid][pKey] = dini_Int(string2,"Password");
Код:
public OnPlayerRequestClass(playerid, classid) { new string[4000]; if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1) { PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/mmo1cocy8o/Harry_Potter_and_the_Sorcerer_s_Stone_Soundtrack_-12._Christmas_at_Hogwarts.mp3"); InterpolateCameraPos(playerid, 2440.208984, -1269.380249, 39.858142, 2421.712646, -1280.368041, 41.623828, 20000); InterpolateCameraLookAt(playerid, 2438.465576, -1264.761718, 39.064632, 2417.636718, -1283.257568, 41.428565, 20000); ClearChatbox(playerid, 10); if(gPlayerNalog[playerid] != 0) { ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_PASSWORD,"{EA0C0C}Dobrodosli,ulogujte se","Ukucajte {EA0C0C}password {FFFFFF}da bi se {EA0C0C}ulogovali{FFFFFF}.","Login","Izadji"); } else { ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_PASSWORD,"{EA0C0C}Dobrodosli, molimo Vas registrujte se","Upisite vas {EA0C0C}password {FFFFFF}da bi {EA0C0C}registrovali novi Nalog{FFFFFF}.","Registruj se","Izadji"); } LoginLog(string); } else { SpawnPlayer(playerid); KillTimer(stopactimer[playerid]); stopactimer[playerid] = SetTimerEx("resumeanticheat", 3000, false, "i", playerid); } return false; }