09.09.2015, 23:52
Quote:
Um exemplo para vocкs:
PHP код:
PHP код:
PHP код:
|
Fiz certinho? O que й essa define?
Код:
#define HASH_SENHA "AEOAUEABABEAEAEOUAEIX" 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 { new senhaecrytada; SHA256_PassHash(inputtext, HASH_SENHA, senhaecrytada, 64); GetPlayerIp(playerid, ip, sizeof(ip)); format(query, sizeof(query), "INSERT INTO `accounts` (`Username`, `Senha`, `IP`) VALUES ('%s', '%s', '%s')", GetName(playerid), senhaecrytada, 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); //int_dest[0] = pInfo[playerid][UserID] = cache_get_field_content_int(0, "UserID"); } } 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 { 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; }