15.11.2016, 19:44
Hello i have one issue, when i register and later try login i can type any style of password and its still login me.
This is me register case INI
And this is login case
This is Load public
This is me register case INI
Код:
new INI:File = INI_Open(UserPath(playerid)); WP_Hash(buf, sizeof(buf), inputtext); INI_SetTag(File,"data"); INI_WriteString(File, "pPassword", buf); INI_WriteInt(File,"pXP",0); INI_WriteInt(File,"pKills",0); INI_WriteInt(File,"pDeaths",0); INI_WriteInt(File,"pRank",0); INI_WriteInt(File,"pEvac",0); INI_WriteInt(File,"pAdminLevel",0); INI_WriteInt(File,"pVipLevel",0); INI_WriteInt(File,"pHour",0); INI_WriteInt(File,"pMin",0); INI_WriteInt(File,"pSec",0); INI_WriteInt(File,"pMapsPlayed",0); INI_WriteString(File,"pIP",IP); INI_Close(File);
Код:
case DIALOG_LOGIN: { if(!response) { ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_MSGBOX,"Kicked",""chat" You must login to play at "NAME"","Close",""); Kick(playerid); } if(response) { new buf[129]; WP_Hash(buf, sizeof(buf), inputtext); if(!strcmp(buf,pInfo[playerid][pPassword])) { INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid); pInfo[playerid][pLogged] = 1; playedtimer[playerid] = SetTimerEx("TimeOnServer", 1000, 1, "i", playerid); SendClientMessage(playerid,-1,""chat""COL_LGREEN" Logged in!"); printf("%s",pInfo[playerid][pPassword]);
Код:
public LoadUser_data(playerid,name[],value[]) { INI_String("pPassword", pInfo[playerid][pPassword], 129); INI_Int("pXP",pInfo[playerid][pXP]); INI_Int("pKills",pInfo[playerid][pKills]); INI_Int("pDeaths",pInfo[playerid][pDeaths]); INI_Int("pRank",pInfo[playerid][pRank]); INI_Int("pEvac",pInfo[playerid][pEvac]); INI_Int("pAdminLevel",pInfo[playerid][pAdminLevel]); INI_Int("pVipLevel",pInfo[playerid][pVipLevel]); INI_Int("pHour",pInfo[playerid][pHour]); INI_Int("pMin",pInfo[playerid][pMin]); INI_Int("pSec",pInfo[playerid][pSec]); INI_Int("pMapsPlayed",pInfo[playerid][pMapsPlayed]); INI_Int("pAdminDuty",pInfo[playerid][pAdminDuty]); return 1; }