Wrong dialog showing up
#1

I have two arrays with 10 skin ID's each. They're called WSKINS and NSKINS.

I also have two dialogs. I want the correct dialog to show up for each array of skins. Right now I get the dialog for NSKINS for "the WSKINS" as well.

Код:
case 0://VAPEN
	        	    {
	        	        if(Skin == NSKINS[0], NSKINS[1], NSKINS[2], NSKINS[3], NSKINS[4], NSKINS[5], NSKINS[6], NSKINS[7], NSKINS[8], NSKINS[9])
	        	        {
	        	            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Weapons", "AK-47 \nSatchel Charges \nArmor", "Purchase", "Exit");
	        	        }
						else
						{
						    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Weapons", "M4 \nMinigun \nArmor", "Purchase", "Exit");
						}
	        	    }
What am I doing wrong? I'm not really sure how to access multiple values from my array... but I don't get any errors with this at least.
Reply
#2

pawn Код:
if(Skin == NSKINS[0], NSKINS[1], NSKINS[2], NSKINS[3], NSKINS[4], NSKINS[5], NSKINS[6], NSKINS[7], NSKINS[8], NSKINS[9])
you cannot compare it like this, you will have to use Skin == ... for every part, and link it with || (or)

pawn Код:
if(Skin == NSKINS[0] || Skin == NSKINS[1] || Skin == NSKINS[2] || ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)