If i use the code below i can only insert argument string if 5 letters. I think it's because "Cadet" has 5 letters. How can i change this?
CASE "!promote":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
IF ( $argv != "" )
THEN
$idxSpace = indexOf( $argv, " ");
IF ( $idxSpace != -1 )
THEN
$option = subStr( $argv,0,$idxSpace );
$argv = trim( subStr( $argv,$idxSpace ) );
SWITCH ( ToLower($option) )
CASE "cadet":
IF ( $argv != "" )
THEN
$speler = subStr( $argv,0,$idxSpace );
$argv = trim( subStr( $argv,$idxSpace ) );
privMsg( "test" );
IF ( UserInGroup( "Police",$speler ) == 1 )
THEN
privMsg( "^7User is already A Officer!!!");
ELSE
MoveUserToGroup( "Police",$speler );
UserGroupToFile( "Police", $Dir["Police"] );
GlobalMsg( langEngine( "%{cruise_cop_new}%",$speler) );
ENDIF
ELSE
privMsg( "Select player" );
ENDIF
BREAK;
ENDSWITCH
ENDIF
ELSE
privMsg ( "Specify Cadet, Officer or OC" );
ENDIF
BREAK;