Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function player::activateStuff(%this)
- {
- %start = %this.getEyePoint();
- %end = vectorAdd(%start, vectorScale(%this.getEyeVector(), 5));
- %ray = containerRayCast(%start, %end, $Typemasks::PlayerObjectType, %this);
- if(isObject(%hit = getWord(%ray, 0)))
- {
- if(%hit.getClassName() $= "AIPlayer")
- {
- if(%hit.getDataBlock().getID() == nameToId(PlayerStandardArmor)) //If for whatever reason there's more bots than just coprses.
- {
- %name = %hit.name;
- %death = %hit.death;
- if(!%hit.located)
- {
- %hit.located = true;
- %str = "\c3" @ %this.client.name @ "\c6 has uncovered the body of \c3" @ %name @ "\c6. He was a(n) " @ %hit.getFormattedRole() @ "\c6!";
- BBB_System.createAnnouncement(%str);
- //Metrics(%str);
- }
- %chtStr = "<just:left>\c1Name\c6:\c3" SPC %name @ "<br>\c0Death\c6:\c3" SPC %death @ "<br>\c2Role\c6:" @ %hit.getFormattedRole();
- commandToClient(%this.client,'centerPrint',%chtStr, 5);
- }
- if(%hit.getDataBlock().getID() == nameToId(HealthStation))
- %this.HPStationHeal(%hit);
- }
- }
- parent::activateStuff(%this);
- }
- function serverCmdUseTool(%client,%slot)
- {
- if(!isObject(%client.player.getMountedObject(0)) && isObject(%client.player))
- {
- %client.schedule(10,cycleUIBBB);
- parent::serverCmdUseTool(%client,%slot);
- }
- }
- function serverCmdUseInventory(%client,%slot)
- {
- parent::serverCmdUseInventory(%client,%slot);
- }
- function armor::onTrigger(%this, %player, %slot, %val)
- {
- if(%slot $= 4)
- {
- if(!%val)
- {
- if(isObject(%bot = %player.getMountedObject(0)))
- {
- %bot.dismount();
- serverCmdUseTool(%player.client,0);
- }
- }
- if(%val)
- {
- %start = %player.getEyePoint();
- %end = vectorAdd(%start, vectorScale(%player.getEyeVector(), 5));
- %ray = containerRayCast(%start, %end, $Typemasks::PlayerObjectType, %player);
- if(isObject(%hit = getWord(%ray, 0)))
- {
- if(%hit.getClassName() $= "AIPlayer")
- {
- %player.unMountImage(0);
- %player.mountObject(%hit, 0);
- }
- }
- }
- }
- parent::onTrigger(%this, %player, %slot, %val);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement