How would I create Multiple if/else statements
#1

How would I create Multiple if/else statements within on case?

For example purposes only.
pawn Код:
.
        case 168://Finalise
        {
            if(!response) return ShowPlayerDialog(playerid, 160, DIALOG_STYLE_LIST, "House Creation Menu", "Set Exterior Position\r\nSet Interior Position\r\nSet Lock\r\nSet Alarm\r\nSet Address\r\nSet Number of Rooms\r\nSet number of Vehicle slots\r\nFinalise","Continue","Close");
            if(response)
            {
                if(Create[playerid][hExtSet] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "Please confirm the {FF8000}Exterior{808080} position of this house.");
                }
                else if(Create[playerid][hIntSet] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "Please confirm the {FF8000}Interior{808080} position of this house.");
                }
Reply
#2

Seriously..? No-one has came up with a solution... -.^
Reply
#3

What do you mean exactly? An if/else statement right in one of the if/else statements?


pawn Код:
else if(Create[playerid][hIntSet] == 0)
{
    SendClientMessage(playerid, COLOR_GREY, "Please confirm the {FF8000}Interior{808080} position of this house.");
    if(RandomVar != 0)
    {
        Ban(playerid);
    }
}
??
Reply
#4

Quote:
Originally Posted by Deal-or-die
Посмотреть сообщение
How would I create Multiple if/else statements within on case?
You just did.
Reply
#5

So what I have should work...? -.^

Well now I feel like a twat.... -.-
Sorry, I'll shut up and cheers for your help.
Reply
#6

Don't get you.
You want it explained? or what?
Reply
#7

Nah, I was told once before by someone I thought was a genius scripter that what I have stated as an example above, would not work, so Without me trialing it I came crying for help here. Cheers for your responses I think this is sorted, and I have learnt not to embarrass myself next time by not trying something before bitching.
Reply
#8

Depeneding on what you're doing, you will want to use switch.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)