I was trying to make like a player function that will spawn you were you died at, or count the damage by projectile as a Score-Point without actually killing the player.
Reason:
Paintball-like Deaths, when you get tagged, you have to return/walk to you team's base in order to re-spawn
Attempts:
I tried to make the player mark a position in which they took damage, then on death, they respawn at the location they last took damage.
1 Problem is, when you restart a mini or end a mini before you respawn, your player datablock will still be at your last damaged position and collide-able and never disappear, even if you restarted the mini and spawned at a brick.
function NPPLPlayer::onDamage(%this,%obj,%am)
{
parent::onDamage(%this,%obj,%am);
if(%obj.getdamagelevel() <= 200)
{
%client = %obj.client;
$NPPL::Taged[%client.bl_id] = %client.player.position;
}
}
package SpawnNPPL
{
function GameConnection::createplayer(%a,%b)
{
Parent::createplayer(%a,%b);
if(getWordCount($NPPL::Taged[%a.bl_id]) >= 1 && isObject(%minigame))
{
%obj.client.play2d(HitCallSound);
%a.player.position = $NPPL::Taged[%a.bl_id];
$NPPL::Taged[%a.bl_id] = "";
}
else
{
commandToClient(%obj.client,'centerPrint',"Minigame<br><color:FFFFFF>required for respawn");
}
}
};
activatePackage(SpawnNPPL);
Any suggestions or better approaches?