This method that I've learned from AdTec shows a nice way to reduce else blocks memory and this is how I do it, maybe results are not visible, but it's certainly an improvement.
function onPlayerCommand( player, cmd, params ) // the actual function
{ // the opening bracket
if( player && cmd ) // Check if player and command exist, not really mandatory..
{ // opening bracket of above 'if'
local delim = cmd.slice( 0, 1 ); // get the first letter from the "cmd" string
switch(delim) // create a switch in which we have our cases.
{// opening bracket of the switch
case "e": // first case
if( cmd == "examplecmd" )
{
Message("Example command1");
}
else if( cmd == "examplecmd2" )
{
Message("Example command2");
}
break; // break first case to start another one, dunno if it's mandatory
case "b":
if( cmd == "blah" )
{
Message("blahblahblah");
}
break;
} // end switch
} // end first bracket
} // end function bracket
Sorry for the awful identation.