Advertisement
Guest User

bot shit

a guest
Aug 6th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. function player::activateStuff(%this)
  2. {
  3. %start = %this.getEyePoint();
  4. %end = vectorAdd(%start, vectorScale(%this.getEyeVector(), 5));
  5. %ray = containerRayCast(%start, %end, $Typemasks::PlayerObjectType, %this);
  6. if(isObject(%hit = getWord(%ray, 0)))
  7. {
  8. if(%hit.getClassName() $= "AIPlayer")
  9. {
  10. if(%hit.getDataBlock().getID() == nameToId(PlayerStandardArmor)) //If for whatever reason there's more bots than just coprses.
  11. {
  12. %name = %hit.name;
  13. %death = %hit.death;
  14. if(!%hit.located)
  15. {
  16. %hit.located = true;
  17. %str = "\c3" @ %this.client.name @ "\c6 has uncovered the body of \c3" @ %name @ "\c6. He was a(n) " @ %hit.getFormattedRole() @ "\c6!";
  18. BBB_System.createAnnouncement(%str);
  19. //Metrics(%str);
  20. }
  21. %chtStr = "<just:left>\c1Name\c6:\c3" SPC %name @ "<br>\c0Death\c6:\c3" SPC %death @ "<br>\c2Role\c6:" @ %hit.getFormattedRole();
  22. commandToClient(%this.client,'centerPrint',%chtStr, 5);
  23. }
  24. if(%hit.getDataBlock().getID() == nameToId(HealthStation))
  25. %this.HPStationHeal(%hit);
  26. }
  27. }
  28. parent::activateStuff(%this);
  29. }
  30. function serverCmdUseTool(%client,%slot)
  31. {
  32. if(!isObject(%client.player.getMountedObject(0)) && isObject(%client.player))
  33. {
  34. %client.schedule(10,cycleUIBBB);
  35. parent::serverCmdUseTool(%client,%slot);
  36. }
  37. }
  38. function serverCmdUseInventory(%client,%slot)
  39. {
  40. parent::serverCmdUseInventory(%client,%slot);
  41. }
  42. function armor::onTrigger(%this, %player, %slot, %val)
  43. {
  44. if(%slot $= 4)
  45. {
  46. if(!%val)
  47. {
  48. if(isObject(%bot = %player.getMountedObject(0)))
  49. {
  50. %bot.dismount();
  51. serverCmdUseTool(%player.client,0);
  52. }
  53. }
  54. if(%val)
  55. {
  56. %start = %player.getEyePoint();
  57. %end = vectorAdd(%start, vectorScale(%player.getEyeVector(), 5));
  58. %ray = containerRayCast(%start, %end, $Typemasks::PlayerObjectType, %player);
  59. if(isObject(%hit = getWord(%ray, 0)))
  60. {
  61. if(%hit.getClassName() $= "AIPlayer")
  62. {
  63. %player.unMountImage(0);
  64. %player.mountObject(%hit, 0);
  65. }
  66. }
  67. }
  68. }
  69. parent::onTrigger(%this, %player, %slot, %val);
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement