Problems with dialogs
#4

Quote:
Originally Posted by arlindi
Посмотреть сообщение
PHP код:
switch(5)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
    case 
DIALOG_GANGCHANGE:// Our dialog!
    
{
        if(!
response) return 0;
        switch(
listitem)// Checking which listitem was selected
        
{
            case 
0:// The first item listed
            
{
                if(
PlayerInfo[playerid] [pTeam] == 0) return SendClientMessage(playerid, -1"You cannot select the same gang.");
                
SetPlayerTeam(playerid0);
                
PlayerInfo[playerid][pTeam] = 0;
                
SetSpawnInfoplayerid0,1862022.1766,1007.5810,10.8203,270.033000000);
                
SpawnPlayer(playerid);
                
SendClientMessage(playerid, -1"Your new gang is Red Dragon Triad.");
            }
            case 
1// The second item listed
            
{
                if(
PlayerInfo[playerid] [pTeam] == 1) return SendClientMessage(playerid, -1"You cannot select the same gang.");
                
SetPlayerTeam(playerid1);
                
PlayerInfo[playerid][pTeam] = 1;
                
SetSpawnInfoplayerid11122194.3840,1676.9290,12.3672,88.403500000);
                
SpawnPlayer(playerid);
                
SendClientMessage(playerid, -1"Your new gang is The Corleone Family.");
            }
        }
    }
}
if(
dialogid == DIALOG_ORDER6)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
    case 
6:// Our dialog!
    
{
    if(!
response) return 0;
        switch(
listitem)// Checking which listitem was selected
        
{
            case 
2:// The first item listed
            
{
                
GivePlayerWeapon(playerid24350);
                
GivePlayerWeapon(playerid31350);
                
GivePlayerWeapon(playerid32550);
                
GivePlayerMoney(playerid, -5000);
                
GameTextForPlayer(playerid"-5000$"30001);
               
            }
            case 
3// The second item listed
            
{
                
GivePlayerWeapon(playerid24350);
                
GivePlayerWeapon(playerid31350);
                
GivePlayerWeapon(playerid32550);
                
GivePlayerWeapon(playerid41);
                
GivePlayerWeapon(playerid34100);
                
GivePlayerMoney(playerid, -10000);
                
GameTextForPlayer(playerid"-10000$"30001);
            }
        }
    }
}
return 
1;
}

You should actually study the code.. you have a case statement without a switch statement.
Reply


Messages In This Thread
Problems with dialogs - by prooftzm - 09.07.2014, 07:37
Re: Problems with dialogs - by Jack_Leslie - 09.07.2014, 07:41
Re: Problems with dialogs - by arlindi - 09.07.2014, 07:57
Re: Problems with dialogs - by Jack_Leslie - 09.07.2014, 08:02
Re: Problems with dialogs - by Jack_Leslie - 09.07.2014, 08:06
Re: Problems with dialogs - by arlindi - 09.07.2014, 08:07

Forum Jump:


Users browsing this thread: 2 Guest(s)