Thanks, and to clarify, this is to prevent players from entering enemy vehicles through bot mount points such as tank turrets. (Slayer does not protect against this)
Any further suggestions?
package restrictedEnemyVehicles
{
function Armor::onCollision(%this, %obj, %col, %a, %b, %c, %d, %e, %f)
{
if(%col.getClassName() $= "Player") // if it's a playerData
{
if(isObject(%col.spawnBrick) && MinigameCanDamage(%obj,%col)) // if it has a spawnbrick and you can damage it (your teams' vehicle)
return Parent::onCollision(%this, %obj, %col, %a, %b, %c, %d, %e, %f); // then it's fine to enter
else
return %obj.client.player.schedule(100, dismount); // otherwise, eject them
}
return Parent::onCollision(%this, %obj, %col, %a, %b, %c, %d, %e, %f);
}
};
activatePackage(restrictedEnemyVehicles);