Advertisement
Zonas

Untitled

Jun 28th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. #pragma semicolon 1
  2.  
  3. #define DEBUG
  4.  
  5. #define PLUGIN_AUTHOR ""
  6. #define PLUGIN_VERSION "0.00"
  7.  
  8. #include <sourcemod>
  9. #include <sdktools>
  10. #include <morecolors>
  11.  
  12. #pragma newdecls required
  13.  
  14. bool Enabled;
  15.  
  16. public Plugin myinfo =
  17. {
  18. name = "",
  19. author = PLUGIN_AUTHOR,
  20. description = "",
  21. version = PLUGIN_VERSION,
  22. url = ""
  23. };
  24.  
  25. public void OnPluginStart()
  26. {
  27. RegConsoleCmd("sm_test", Command_Test, "Spawns a bot");
  28. }
  29.  
  30. public Action Command_Test(int client, int args)
  31. {
  32. if (Enabled)
  33. {
  34. Enabled = false;
  35. ServerCommand("tf_bot_kick all");
  36. CPrintToChatAll("{fullred}[SVH] {darkgray}Test Bot Disabled");
  37. }
  38.  
  39. else
  40. {
  41. ServerCommand("mp_autoteambalance 0");
  42. ServerCommand("tf_bot_add 1 Pyro blue easy");
  43. ServerCommand("tf_bot_difficulty 0");
  44. ServerCommand("tf_bot_keep_class_after_death 1");
  45. ServerCommand("tf_bot_taunt_victim_chance 0");
  46. ServerCommand("tf_bot_join_after_player 0");
  47. Enabled = true;
  48. CPrintToChatAll("{fullred}[SVH] {darkgray}Test Bot Enabled");
  49. }
  50. return Plugin_Handled;
  51. }
  52.  
  53. public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  54. {
  55. if (!Enabled && !IsPlayerAlive(client) && IsClientBot(client)) return Plugin_Continue;
  56. new rocket = INVALID_ENT_REFERENCE;
  57. decl Float:fClientEyePosition[3];
  58. GetClientEyePosition(client, fClientEyePosition);
  59. while ((rocket = FindEntityByClassname(rocket, "tf_projectile_*")) != INVALID_ENT_REFERENCE)
  60. {
  61. decl Float:rocketLocation[3];
  62. GetEntPropVector(rocket, Prop_Data,"m_vecOrigin",entityLocation);
  63. decl Float:pos[3];
  64. GetClientAbsOrigin(client, pos);
  65. decl Float:angle[3];
  66. angle[0] = 0.0 - RadToDeg(ArcTangent((entityLocation[2] - fClientEyePosition[2]) / (FloatAbs(SquareRoot(Pow(fClientEyePosition[0] - entityLocation[0], 2.0) + Pow(entityLocation[1] - fClientEyePosition[1], 2.0))))));
  67. angle[1] = GetAngle(fClientEyePosition, entityLocation);
  68. if (GetVectorDistance(pos, entityLocation) < 250.0)
  69. {
  70. TeleportEntity(client, NULL_VECTOR, angle, NULL_VECTOR);
  71. ModRateOfFire(iWeapon);
  72. buttons |= IN_ATTACK2;
  73. }
  74. }
  75. }
  76.  
  77. stock bool:IsClientBot(client)
  78. {
  79. return client != 0 && IsClientInGame(client) && IsFakeClient(client) && !IsClientReplay(client) && !IsClientSourceTV(client);
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement