Unreachable code
#5

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid == ConfigDialog)
    {
        case 
1:
        {
               switch(
listitem)
            {
                case 
0:
                {
                    if(
response)
                    {
                        
ShowPlayerDialog(playerid,MaxLevelDialog,DIALOG_STYLE_INPUT,"Change max. VIP level:","Insert your new max. VIP level!","Change","Back");
                    }
                    else
                    {
                        return 
0;
                    }
                }
                case 
1:
                {
                    if(
response)
                    {
                        
ShowPlayerDialog(playerid,MoneyForJoin,DIALOG_STYLE_INPUT,"Change money for join:","Insert your new ammount of money which\nwill VIP player receive when they connect!","Change","Back");
                    }
                    else
                    {
                        return 
0;
                    }
                }
                case 
2:
                {
                    if(
response)
                    {
                        
ShowPlayerDialog(playerid,ScoreForJoin,DIALOG_STYLE_INPUT,"Change score for join:","Insert your new ammount of score which\nwill VIP player receive when they connect!","Change","Back");
                    }
                    else
                    {
                        return 
0;
                    }
                }
                case 
3:
                {
                    if(
response)
                    {
                        
SendClientMessage(playerid,COLOR_RED,"{FF0000}ERROR: {FFFFFF}You cant change ammount of total VIP accounts!");
                        new 
cfg[500];
                        
format(cfg,sizeof(cfg),"{FFFFFF}Max VIP Level:\t\t{FFFF00}%d\n{FFFFFF}Money for join:\t\t{FFFF00}%d$\n{FFFFFF}Score for join:\t\t{FFFF00}%d\n{FFFFFF}Total accounts:\t\t{FFFF00}%d",MaxLevel,MoneyAdd,ScoreAdd,TotalAccounts);
                        
ShowPlayerDialog(playerid,ConfigDialog,DIALOG_STYLE_LIST,"{00FF40}VIP System Configuration:",cfg,"Select","Close");
                    }
                    else
                    {
                        return 
0;
                    }
                }
            }
        }
    }
    switch(
dialogid == MaxLevelDialog)
    {
        case 
1:
        {
            if(
response)
            {
                new 
MAX_LVL[50];
                new 
lvl strval(inputtext);
                
format(MAX_LVL,sizeof(MAX_LVL),"VIP/Files/Configuration.txt");
                if(
dini_Exists(MAX_LVL))
                {
                    
dini_IntSet(MAX_LVL,"MaxVipLevel",lvl);
                }
                new 
cfg[500];
                
format(cfg,sizeof(cfg),"{FFFFFF}Max VIP Level:\t\t{FFFF00}%d\n{FFFFFF}Money for join:\t\t{FFFF00}%d$\n{FFFFFF}Score for join:\t\t{FFFF00}%d\n{FFFFFF}Total accounts:\t\t{FFFF00}%d",MaxLevel,MoneyAdd,ScoreAdd,TotalAccounts);
                
ShowPlayerDialog(playerid,ConfigDialog,DIALOG_STYLE_LIST,"{00FF40}VIP System Configuration:",cfg,"Select","Close");
            }
            else if(!
response)
            {
                new 
cfg[500];
                
format(cfg,sizeof(cfg),"{FFFFFF}Max VIP Level:\t\t{FFFF00}%d\n{FFFFFF}Money for join:\t\t{FFFF00}%d$\n{FFFFFF}Score for join:\t\t{FFFF00}%d\n{FFFFFF}Total accounts:\t\t{FFFF00}%d",MaxLevel,MoneyAdd,ScoreAdd,TotalAccounts);
                
ShowPlayerDialog(playerid,ConfigDialog,DIALOG_STYLE_LIST,"{00FF40}VIP System Configuration:",cfg,"Select","Close");
            }
        }
     }
     switch(
dialogid == MoneyForJoin)
    {
        case 
1:
        {
            if(
response)
            {
                new 
MONEY_JOIN[50];
                new 
money strval(inputtext);
                
format(MONEY_JOIN,sizeof(MONEY_JOIN),"VIP/Files/Configuration.txt");
                if(
dini_Exists(MONEY_JOIN))
                {
                    
dini_IntSet(MONEY_JOIN,"MoneyForJoin",money);
                }
                new 
cfg[500];
                
format(cfg,sizeof(cfg),"{FFFFFF}Max VIP Level:\t\t{FFFF00}%d\n{FFFFFF}Money for join:\t\t{FFFF00}%d$\n{FFFFFF}Score for join:\t\t{FFFF00}%d\n{FFFFFF}Total accounts:\t\t{FFFF00}%d",MaxLevel,MoneyAdd,ScoreAdd,TotalAccounts);
                
ShowPlayerDialog(playerid,ConfigDialog,DIALOG_STYLE_LIST,"{00FF40}VIP System Configuration:",cfg,"Select","Close");
            }
            else if(!
response)
            {
                new 
cfg[500];
                
format(cfg,sizeof(cfg),"{FFFFFF}Max VIP Level:\t\t{FFFF00}%d\n{FFFFFF}Money for join:\t\t{FFFF00}%d$\n{FFFFFF}Score for join:\t\t{FFFF00}%d\n{FFFFFF}Total accounts:\t\t{FFFF00}%d",MaxLevel,MoneyAdd,ScoreAdd,TotalAccounts);
                
ShowPlayerDialog(playerid,ConfigDialog,DIALOG_STYLE_LIST,"{00FF40}VIP System Configuration:",cfg,"Select","Close");
            }
        }
     }
     switch(
dialogid == ScoreForJoin)
    {
        case 
1:
        {
            if(
response)
            {
                new 
SCORE_JOIN[50];
                new 
score strval(inputtext);
                
format(SCORE_JOIN,sizeof(SCORE_JOIN),"VIP/Files/Configuration.txt");
                if(
dini_Exists(SCORE_JOIN))
                {
                    
dini_IntSet(SCORE_JOIN,"ScoreForJoin",score);
                }
                new 
cfg[500];
                
format(cfg,sizeof(cfg),"{FFFFFF}Max VIP Level:\t\t{FFFF00}%d\n{FFFFFF}Money for join:\t\t{FFFF00}%d$\n{FFFFFF}Score for join:\t\t{FFFF00}%d\n{FFFFFF}Total accounts:\t\t{FFFF00}%d",MaxLevel,MoneyAdd,ScoreAdd,TotalAccounts);
                
ShowPlayerDialog(playerid,ConfigDialog,DIALOG_STYLE_LIST,"{00FF40}VIP System Configuration:",cfg,"Select","Close");
            }
            else if(!
response)
            {
                new 
cfg[500];
                
format(cfg,sizeof(cfg),"{FFFFFF}Max VIP Level:\t\t{FFFF00}%d\n{FFFFFF}Money for join:\t\t{FFFF00}%d$\n{FFFFFF}Score for join:\t\t{FFFF00}%d\n{FFFFFF}Total accounts:\t\t{FFFF00}%d",MaxLevel,MoneyAdd,ScoreAdd,TotalAccounts);
                
ShowPlayerDialog(playerid,ConfigDialog,DIALOG_STYLE_LIST,"{00FF40}VIP System Configuration:",cfg,"Select","Close");
            }
        }
     }
    return 
1;
    
    if(
dialogid == VIPMENU)
    {
        if(
response
        {
            if(
listitem == 0// Health
            
{
               if(
PlayerData[playerid][Level] >= 1)
                    {
                    
SetPlayerHealth(playerid,100);
                 }
            }
            if(
listitem == 1// Armour
            
{
               if(
PlayerData[playerid][Level] >= 1)
                    {
                   
SetPlayerArmour(playerid,100);
                 }
            }
            if(
listitem == 2// Weaponry
            
{
               if(
PlayerData[playerid][Level] >= 1)
              {
                
GivePlayerWeapon(playerid4,1);
                
GivePlayerWeapon(playerid24,8000);
                
GivePlayerWeapon(playerid26,8000);
                
GivePlayerWeapon(playerid32,8000);
                
GivePlayerWeapon(playerid34,8000); 
              }
            }
            if(
listitem == 3// Nos
            
{
               if(
PlayerData[playerid][Level] >= 1)
               {
                
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
               }
            }
            if(
listitem == 1// Vehicle HP
            
{
               if(
PlayerData[playerid][Level] >= 1)
                    {
                   new 
vehicleid GetPlayerVehicleID(playerid);
                   
SetVehicleHealth(vehicleid1000.0);
                 }
            }
        }
        return 
1// We handled a dialog, so return 1. Just like OnPlayerCommandText.
    
}
    return 
1;

Reply


Messages In This Thread
Unreachable code - by geohareas - 04.02.2013, 11:23
Re: Unreachable code - by DiGiTaL_AnGeL - 04.02.2013, 11:53
Re: Unreachable code - by geohareas - 04.02.2013, 11:58
Re: Unreachable code - by LarzI - 04.02.2013, 12:00
Re: Unreachable code - by geohareas - 04.02.2013, 12:21
Re: Unreachable code - by LarzI - 04.02.2013, 12:25
Re: Unreachable code - by geohareas - 04.02.2013, 12:35
Re: Unreachable code - by LarzI - 04.02.2013, 13:31
Re: Unreachable code - by MP2 - 04.02.2013, 13:55

Forum Jump:


Users browsing this thread: 2 Guest(s)