if(dialogid == DIALOG_REGISTER)
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
INI_SetTag(File,"data");
INI_WriteString(File, "Password", hashpass);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Muted",0);
INI_WriteInt(File,"Regular",0);
INI_Close(File);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Success!","Great! You have succesfully created your account!","Ok","");
}
}
if(dialogid == DIALOG_LOGIN)
{
if (!response) return Kick(playerid);
if(response)
{
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password
if(!strcmp(hashpass,SInfo[playerid][pPass]))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, SInfo[playerid][pCash]);
SetPlayerScore(playerid, SInfo[playerid][pScore]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","You have entered an incorrect password.\nPlease retype your password below to login.","Login","Quit");
}
return 1;
}
}
return 0;
}
Where are you loading the player stats from?
SInfo[playerid][pPass] |
enum PInfo
{
Name[60],
pPass[129],
pCash,
pAdmin,
pKills,
pDeaths,
pScore,
pOnDuty,
pBan,
pMute,
pRegular
};
new SInfo[MAX_PLAYERS][PInfo];
if(dialogid == DIALOG_LOGIN)
{
if (!response) return Kick(playerid);
if(response)
{
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass,SInfo[playerid][pPass],true,128))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, SInfo[playerid][pCash]);
SetPlayerScore(playerid, SInfo[playerid][pScore]);
SendClientMessage(playerid,COLOR_KS,"Welcome back! You have successfully logged in");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","You have entered an incorrect password.\nPlease retype your password below to login.","Login","Quit");
}
}
return 1;
}
return 0;
}
Make sure your strings are not empty. (Use printf or SendClientMessage)
|
Read what's being said, instead of selectively ignoring certain posts.
|
if(dialogid == DIALOG_LOGIN)
{
if (!response) return Kick(playerid);
if(response)
{
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(hashpass == SInfo[playerid][pPass]))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, SInfo[playerid][pCash]);
SetPlayerScore(playerid, SInfo[playerid][pScore]);
SendClientMessage(playerid,COLOR_KS,"Welcome back! You have successfully logged in");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","You have entered an incorrect password.\nPlease retype your password below to login.","Login","Quit");
}
}
return 1;
}
return 0;
}
PHP код:
|
C:\Documents and Settings\Owner\Desktop\Jaysens crap\DDPUSI TDM\gamemodes\DDPTDM.pwn(901) : error 033: array must be indexed (variable "hashpass") C:\Documents and Settings\Owner\Desktop\Jaysens crap\DDPUSI TDM\gamemodes\DDPTDM.pwn(901) : error 029: invalid expression, assumed zero C:\Documents and Settings\Owner\Desktop\Jaysens crap\DDPUSI TDM\gamemodes\DDPTDM.pwn(908) : error 029: invalid expression, assumed zero
if(hashpass == SInfo[playerid][pPass]))