18.11.2015, 04:10
To login u dont need use your password on myserver all's players password work in all players
Someone can help me to fix it?
Someone can help me to fix it?
Код:
#define HASH_SENHA "AEOAUEABABEAEAEOUAEIX"
Код:
new query[1024], ip[25]; if(dialogid == DIALOG_REGISTER) { if(!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Please enter a valid password!", "Please enter a valid registration password\nTo continue press Register\n\nOxiRegister 1.0\n", "Register", "Quit"); else { SHA256_PassHash(inputtext, HASH_SENHA, pInfo[playerid][pSenha], 64); GetPlayerIp(playerid, ip, sizeof(ip)); format(query, sizeof(query), "INSERT INTO `accounts` (`Username`, `Senha`, `IP`) VALUES ('%s', '%s', '%s')", GetName(playerid), pInfo[playerid][pSenha], ip); mysql_query(ConnectMYSQL,query); pInfo[playerid][Registered] = true; pInfo[playerid][LoggedIn] = true; Logado[playerid] = 1; tutorial[playerid] = -1; SetPlayerHealthEx(playerid, 100); pInfo[playerid][UserID] = cache_get_field_content_int(0, "UserID"); OnPlayerLogin(playerid); } } return 1; } if(dialogid == DIALOG_LOGIN) { if(!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Please enter a valid password!", "Please enter your valid logging in password\nTo continue press log-in", "Log-in", "Quit"); else { new Senha[64]; SHA256_PassHash(inputtext,HASH_SENHA,Senha,64); mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT * FROM accounts WHERE Senha = '%e' LIMIT 0,1", Senha); mysql_pquery(ConnectMYSQL, query, "OnLogin", "d", playerid); } } return 1; }