[Error with YSI\y_ini]
#9

You shouldn't save password and other data that you know they will not change during the player's gameplay.

On another note, you had Kick function outside of the response so the player would get kicked no matter what. I changed few things:
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialog)
    {
        case 
Dialog_Register:
        {
            if(!
response) return xxx(playeridRed"Relog and try to register next time :D"), kick(playerid);
            new 
hashpass[129];
            
WP_Hash(hashpasssizeof(hashpass), inputtext);
          
            if(!
inputtext[0]) return ShowPlayerDialog(playeridDialog_RegisterDIALOG_STYLE_INPUT""White"Registering...",""Red"You have entered an invalid password.\n"White"Type your password below to register a new account.","Register","Quit"); 
            
            new 
INI:File INI_Open(UserPath(playerid)); 
            
INI_SetTag(File,"Superhuman_Roleplay"); 
            
INI_WriteString(file,"Password",hashpass); 
            
INI_WriteInt(File,"Cash",0); 
            
INI_WriteInt(File,"Admin",0); 
            
INI_WriteString(File,"NormalName",GetPlayerName(playeridnNamesizeof(nName),MAX_PLAYER_NAME); 
            
INI_WriteInt(File,"NormalLevel",0128); 
            
INI_WriteInt(File,"NormalSkin",26128); 
            
INI_WriteString(File,"NormalAbility","None"128); 
            
INI_WriteString(File,"NormalWeakness","None"128); 
            
INI_WriteString(File,"SuperName","None"128); 
            
INI_WriteInt(File,"SuperLevel",0); 
            
INI_WriteInt(File,"SuperSkin",0); 
            
INI_WriteString(File,"Ability_1","None"128); 
            
INI_WriteString(File,"Ability_2","None"128); 
            
INI_WriteString(File,"Ability_3","None"128); 
            
INI_WriteString(File,"Weakness_1","None"128); 
            
INI_WriteString(File,"Weakness_2","None"128); 
            
INI_WriteString(File,"Weakness_3","None"128); 
            
INI_Close(File); 
        }
        case 
Dialog_Login:
        {
            if(!
response) return xxx(playeridRed"Relog and try to login next time :D"), kick(playerid);
            new 
hashpass[129];
            
WP_Hash(hashpasssizeof(hashpass), inputtext);
            if(!
strcmp(hashpassshInfo[playerid][pPass], false))
            {
                
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                
GivePlayerMoney(playeridshInfo[playerid][pCash]);
                
ShowPlayerDialog(playeridDialog_Success_2DIALOG_STYLE_MSGBOX,""White"Success!",""Green"You have successfully logged in!","Ok",""); 
            }
            else 
ShowPlayerDialog(playeridDialog_LoginDIALOG_STYLE_INPUT,""White"Login",""Red"You have entered an incorrect password.\n"White"Type your password below to login.","Login","Quit"); 
        }
        default: return 
0// dialogid not found, search in other scripts
    
}
    return 
1// dialogid was found

Reply


Messages In This Thread
[Error with YSI\y_ini] - by Dreamwall - 30.06.2016, 21:34
Re: [Error with YSI\y_ini] - by Konstantinos - 30.06.2016, 21:45
Re: [Error with YSI\y_ini] - by Dreamwall - 30.06.2016, 22:06
Re: [Error with YSI\y_ini] - by Dreamwall - 30.06.2016, 22:25
Re: [Error with YSI\y_ini] - by DTV - 01.07.2016, 00:52
Re: [Error with YSI\y_ini] - by Dreamwall - 01.07.2016, 17:04
Re: [Error with YSI\y_ini] - by DTV - 01.07.2016, 17:26
Re: [Error with YSI\y_ini] - by Dreamwall - 01.07.2016, 20:03
Re: [Error with YSI\y_ini] - by Konstantinos - 01.07.2016, 20:30

Forum Jump:


Users browsing this thread: 3 Guest(s)