going back to the switch statment, you can use
Code:
switch( int )
{
case 0,1,2,3,4: //code
case 0..4: //code (these are the same)
}
You can use it with strings (somewhat). You can only use it with characters not full strings. Lesson in PAWN, strings are merely arrays of integers but hold the value of a string character and it ends with a termination character ( "^0")
example
Code:
new myString[6]
format(myString , 5 , "hello")
//will hold an array like so
// [0] : h
// [1] : e
// [2] : l
// [3] : l
// [4] : o
// [5] : ^0
So if you want to use a switch with a string you do it like so
Code:
switch( myString[1] )
{
case 'h': //code
case 'e': //code (this would be called with my example)
case 'l','o': //code
case '^0': //code
case 0: //would work the same as above
default: //code
}
So, in knowing this. If you have a string and you know it can only be a couple things you can use a switch on the first character ([0]) given that the first character is unique in the different ones that would be used.