User's Data Problem
#4

But can you fix the warning(already stated below)..i try to fix the warning with your guide but it still persist..

line 118
Код:
   				return 1;
line 122
Код:
   	return 1;
whole code
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(inputtext[0] == 0 || (inputtext[0] == 1 && inputtext[1] == 0)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
                new hashpass[129];
                WP_Hash(hashpass,sizeof(hashpass),inputtext);
                new INI:File = INI_Open(UserPath(playerid));
                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,"Vip",0);
                INI_Close(File);
                new string[256], pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pname, sizeof(pname));
                format( string, sizeof(string), "Welcome To {CCFF33}Cyber {66CCFF}Malaysian {FFCC99}Army,  {FF6600}%s{FFFFFF}", pname);
    			SendClientMessage(playerid, 0xFFFFFFFF, string);
                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
			}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
               new hashpass[129];
               WP_Hash(hashpass,sizeof(hashpass),inputtext);
               if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false)) 
                {
                    new string[256], pname[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
					ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
					format( string, sizeof(string), "Welcome Back,  {FF6600}%s{FFFFFF}", pname);
    				SendClientMessage(playerid, 0xFFFFFFFF, string);
					SendClientMessageToAll( -1, szStr);
				 }
    			else
      			{
        			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
        		}
  				return 1;
     	  }
  	  	}
 	 }
  	return 1;
}
Reply


Messages In This Thread
[SOLVED]User's Data Problem - by Armageddonz - 07.06.2015, 01:05
Re: User's Data Problem - by Yashas - 07.06.2015, 03:16
Re: User's Data Problem - by Armageddonz - 07.06.2015, 04:14
Re: User's Data Problem - by Armageddonz - 07.06.2015, 04:28
Re: User's Data Problem - by Armageddonz - 07.06.2015, 04:42
Re: User's Data Problem - by Yashas - 07.06.2015, 04:55

Forum Jump:


Users browsing this thread: 1 Guest(s)