Unfortunately you can't use a switch because get_user_flags() will return a bitsum. So it will never be EQUAL TO ADMIN_KICK, it will INCLUDE ADMIN_KICK.
You could use this:
Code:
switch ( get_user_flags(id) & ( ADMIN_KICK | ADMIN_SLAY ) ) {
case ADMIN_KICK : {} // Only kick
case ADMIN_SLAY : {} // Only slay
case ( ADMIN_KICK | ADMIN_SLAY ) : {} // Both
default : {} // Neither
}
But I'm sure you can see that it's just not good enough. You immediately have to create one more option. And for every option added, the number of options around grows exponentially since you have to take consideration for all the different combinations of options.
Also, if you are considering converting it to cvars to be able to change the different levels required more easily by the end user, switches are out completely.
If you have all of these in multiple locations I would say that your menu system is not dynamic enough. You can definitely make it more dynamic and end up with one handler with just one message.
But if you find it hard to create that kind of advanced menu, then I would suggest a stock.
In the end it's a function that is called whenever someone uses a command or a menu which is rare in general. You do not have to worry about performance at all and should use the method that makes the code easy to work with without breaking readability.
__________________