10.04.2015, 18:07
PHP код:
forward MySQL_Login(playerid);
public MySQL_Login(playerid)
{
cache_get_field_content(0,"Username", pInfo[playerid][pUsername]);
cache_get_field_content(0, "Password",pInfo[playerid][pPassword]);
pInfo[playerid][pXP] = cache_get_field_content_int(0, "XP");
pInfo[playerid][pKills] = cache_get_field_content_int(0, "Kills");
pInfo[playerid][pDeaths] = cache_get_field_content_int(0, "Deaths");
pInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank");
pInfo[playerid][pEvac] = cache_get_field_content_int(0, "Evac");
pInfo[playerid][pAdminLevel] = cache_get_field_content_int(0, "AdminLevel");
pInfo[playerid][pVipLevel] = cache_get_field_content_int(0, "VipLevel");
pInfo[playerid][pHour] = cache_get_field_content_int(0, "Hour");
pInfo[playerid][pMin] = cache_get_field_content_int(0, "Min");
pInfo[playerid][pSec] = cache_get_field_content_int(0, "Sec");
pInfo[playerid][pMapsPlayed] = cache_get_field_content_int(0, "MapsPlayed");
pInfo[playerid][pCoins] = cache_get_field_content_int(0, "Coins");
pInfo[playerid][pLogged] = 1;
CheckBan(playerid);
playedtimer[playerid] = SetTimerEx("TimeOnServer", 1000, 1, "i", playerid);
return 1;
}
The password hen register he got save as hashed
I want when use it to be uset also login as hashed because i cant find the password in this line
cache_get_field_content(0, "Password",pInfo[playerid][pPassword]);
Here is and the Register
PHP код:
case DIALOG_REGISTER:
{
if(response)
{
if(!strlen(inputtext) || strlen(inputtext) > 128)
{
new string[128];
SendClientMessage(playerid, -1, ""chat" You must insert a password between 1-128 characters!");
format(string,sizeof(string),""chat" Hello %s to "NAME"",PlayerName(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD ,string,""chat" Welcome to "NAME" you'll be forced to register please click register!","Register","Quit");
}
else if(strlen(inputtext) > 0 && strlen(inputtext) < 128)
{
new escpass[100];
mysql_real_escape_string(inputtext, escpass);
MySQL_Register(playerid, escpass);
TextDrawHideForPlayer(playerid, login0);
TextDrawHideForPlayer(playerid, login1);
TextDrawHideForPlayer(playerid, login2);
TextDrawHideForPlayer(playerid, login3);
}
}
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_MSGBOX,"Kicked",""chat" You must register to play at "NAME"","Close","");
Kick(playerid);
}
}