help with case
#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


Messages In This Thread
help with case - by Karolukas123 - 02.02.2015, 02:49
Re: help with case - by Schneider - 02.02.2015, 03:09
Re: help with case - by Karolukas123 - 02.02.2015, 03:16
Re: help with case - by Schneider - 02.02.2015, 04:14
Re: help with case - by Karolukas123 - 02.02.2015, 04:29
Re: help with case - by F1re - 02.02.2015, 09:53

Forum Jump:


Users browsing this thread: 1 Guest(s)