help with case
#1



As the case make it clicks once sent her a message and the second time you sent yet another message
Reply
#2

You can't use else-statements in a switch. You could however use a default-statement:

pawn Код:
switch(something)
{
    case 0: { if something is '0' }
    case 1: { if something is '1' }
    case 2, 3, 4: { if something is 2, 3 or 4 }
    case 5..20:    { if something is between 5 and 20 }
    default:         { this is like an 'else-statement' if no other matches were found }
}
Reply
#3


Im get error
Reply
#4

If you use multiple functions in 1 case, you have to put them between brackets { }

Just do it like you did in the first post, but change 'else' to 'default'.
Reply
#5

Quote:
Originally Posted by Schneider
Посмотреть сообщение
If you use multiple functions in 1 case, you have to put them between brackets { }

Just do it like you did in the first post, but change 'else' to 'default'.
I did as you said, but I still did not work. I'm running all the choices are not used but not the only one I want.
Reply
#6

Quote:
Originally Posted by Karolukas123
Посмотреть сообщение

Im get error
Код:
RodomGreitaMygtuka = false;
You need to put a comma.

Код:
switch(RodomGreitaMygtuka)
{
    case 0: RodomGreitaMygtuka = false, SendClientMessage(playerid, -1, "...");
    default: RodomGreitaMygtuka = true, SendClientMessage(playerid, -1, "...");
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)