SA-MP Forums Archive
Help with Dialog Switching - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with Dialog Switching (/showthread.php?tid=270886)



Help with Dialog Switching - R3G1ST3R - 22.07.2011

I need help with my dialog, I'm making it so when a player types /spawncar a dialog will pop up with Casual Cars, Sports Cars, Helicopters, Airplanes, bikes, but how do I make it so when they hit Casual Cars another dialog will pop up letting them choose the car, thanks.


Re: Help with Dialog Switching - TheYoungCapone - 22.07.2011

you show the casual cars list on the response of the first dialog


Re: Help with Dialog Switching - R3G1ST3R - 22.07.2011

@TheYoungCapone Could you please explain? mabye give some examples? IGNORE EVERYTHING INSIDE THE CASE

Код:
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
		case 1069:// Our dialog!
    	    {
           	switch(listitem)// Checking which listitem was selected
        	{
        	    case 0:// Casual Cars - First item in the Dialog
        	    {
        	        switch(1070)
        	    }
        	    case 1: // Sport Vehicles - Second Item In the Dialog
        	    {
        	        if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -2);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
        	    }
        	    case 2: // Trucks - Third item in the dialog
        	    {
        	        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -3);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
        	    }
        	    case 3: // Vans - Fourth item in the dialog
        	    {
        	        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -3);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
        	    }
        	    case 4: // Helicopter - Fith item in the dialog
        	    {
        	        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -3);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
        	    }
 	     	 	case 5: // Airplanes - Sixth item in the dialog
        	    {
        	        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -3);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
        	    }
        	    case 6: // Bikes - Seventh item in the dialog
        	    {
        	        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -3);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
        	    }
        	}
    	    }
	}
    }
Код:
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
		case 1070:// Our dialog!
    	    {
           	switch(listitem)// Checking which listitem was selected
        	{
        	    case 0:// The first item listed
        	    {

        	    }
        	    case 1: // The second item listed
        	    {
        	        if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -2);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
        	    }
        	    case 2: // The third item listed
        	    {
        	        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
        	        GivePlayerMoney(playerid, -3);
        	        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
        	    }
        	}
    	    }
	}
    }
return 1;
}