Well this is the important bit, I've changed the comments a bit:
function serverCmdRemoveMe(%client){
%index = -1; // %index will record where they are in the list, and it's -1 to start because 0 would be a valid position.
for(%i = 1; %i <= $ClientListCount; %i++) { // loop through the whole list
if( $ClientList[ %i ] == %client ) { // if current value at the position in the array is what we are looking for
// Yep, they're on the list
%index = %i; // Remember where in the list
break; // end the loop
}
}
if( %index < 0 ) { // If the -1 has not been changed, this will equate to true
// They're not on the list!!
messageClient(%client, '', '\c3You\'re not on the list...');
return;
}
// Remove them from the list
$ClientList[ %index ] = "";
// Bump back all the clients so we don't have a blank space in our $ClientList array
for(%i = %index; %i <= $ClientListCount; %i++) {
// %i = %index - start from the position we have just removed
// %i <= $ClientListCount - loop to the end of the list
$ClientList[ %i ] = $ClientList[ %i + 1 ]; // Set the current value in the array to the one (above/after) it
}
$ClientListCount--; // Deduct from the total
}
Of course you'd have to change it to deal with bananas or whatever you are doing.