Armor::onRemove would be when the player has been dead for a few seconds and clients can respawn before that without a "flag" to delete, then when their still-dead body dissapears it leaves a permaflag.
A better idea would be to use a package with GameConnection::onDeath:
package DeathCheck
{
function GameConnection::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc)
{
if(isObject(%this.player))
{
%flag = new Item()
{
datablock = flagItem;
position = %this.player.position;
rotation = "0 0 0 0";
};
%flag.schedule(7500,0,delete);
}
Parent::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc);
}
};
activatePackage(DeathCheck);
You have to define the item "flagItem" somewhere else along with code to mount it/etc when picked up.
I actually have a CTF mode for the Team Deathmatch but it is very buggy and unreleased.