Help with Dialogs
#4

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
       new 
str2[150];
    
format(str2150"Arma\tMunizioni\tDisponibile\n\
    Deagle\t9999\tN/D\n\
    Shotgun\t9999\tN/D\n\
    Mp5\t1000\t%d\n\
    M4\t1000\t%d\n\
    Sniper\t100\t%d\n"
cwdisarmi[0], cwdisarmi[1], cwdisarmi[2]);
    if(
dialogid == 5829)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0GivePlayerWeapon(playerid249999);
                case 
1GivePlayerWeapon(playerid259999);
                case 
2:
                        if(
cwdisarmi[0] > 0)
                        {
                            
GivePlayerWeapon(playerid281000);
                            
cwdisarmi[0]--;
                            
SendClientMessage(playerid, -1"a");
                        }
                case 
3:
                        if(
cwdisarmi[1] > 0)
                        {
                            
GivePlayerWeapon(playerid311000);
                            
cwdisarmi[1]--;
                        }
                case 
4
                        if(
cwdisarmi[2] > 0)
                        {
                            
GivePlayerWeapon(playerid34100);
                            
cwdisarmi[1]--;
                        }
            }
               return 
ShowPlayerDialog(playerid5830DIALOG_STYLE_TABLIST_HEADERS"Arma n° 2"str2"Vai""");
        }
    }
    if(
dialogid == 5830)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:
                    if(
GetPlayerWeapon(playerid) != 24)
                        
GivePlayerWeapon(playerid249999), cwtimer[playerid][1] = 1;
                case 
1:
                    if(
GetPlayerWeapon(playerid) != 25)
                        
GivePlayerWeapon(playerid259999), cwtimer[playerid][1] = 1;
                case 
2:
                    if(
GetPlayerWeapon(playerid) != 28)
                        
GivePlayerWeapon(playerid289999), cwtimer[playerid][1] = 1;
                case 
3:
                    if(
GetPlayerWeapon(playerid) != 31)
                        
GivePlayerWeapon(playerid319999), cwtimer[playerid][1] = 1;
                case 
4:
                    if(
GetPlayerWeapon(playerid) != 34)
                        
GivePlayerWeapon(playerid349999), cwtimer[playerid][1] = 1;
            }
            return 
1;
        }
    }
    return 
0// You MUST return 0 here! Just like OnPlayerCommandText.

@Denying +1
Reply


Messages In This Thread
Help with Dialogs - by Minatoo - 21.01.2017, 10:29
Re: Help with Dialogs - by Yaa - 21.01.2017, 10:43
Re: Help with Dialogs - by Denying - 21.01.2017, 10:43
Re: Help with Dialogs - by Yaa - 21.01.2017, 10:49
Re: Help with Dialogs - by Minatoo - 21.01.2017, 10:51
Re: Help with Dialogs - by Minatoo - 21.01.2017, 10:55
Re: Help with Dialogs - by Minatoo - 21.01.2017, 11:04
Re: Help with Dialogs - by Minatoo - 21.01.2017, 11:07

Forum Jump:


Users browsing this thread: 2 Guest(s)