Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #define DEBUG
- #define PLUGIN_AUTHOR ""
- #define PLUGIN_VERSION "0.00"
- #include <sourcemod>
- #include <sdktools>
- #include <morecolors>
- #pragma newdecls required
- bool Enabled;
- public Plugin myinfo =
- {
- name = "",
- author = PLUGIN_AUTHOR,
- description = "",
- version = PLUGIN_VERSION,
- url = ""
- };
- public void OnPluginStart()
- {
- RegConsoleCmd("sm_test", Command_Test, "Spawns a bot");
- }
- public Action Command_Test(int client, int args)
- {
- if (Enabled)
- {
- Enabled = false;
- ServerCommand("tf_bot_kick all");
- CPrintToChatAll("{fullred}[SVH] {darkgray}Test Bot Disabled");
- }
- else
- {
- ServerCommand("mp_autoteambalance 0");
- ServerCommand("tf_bot_add 1 Pyro blue easy");
- ServerCommand("tf_bot_difficulty 0");
- ServerCommand("tf_bot_keep_class_after_death 1");
- ServerCommand("tf_bot_taunt_victim_chance 0");
- ServerCommand("tf_bot_join_after_player 0");
- Enabled = true;
- CPrintToChatAll("{fullred}[SVH] {darkgray}Test Bot Enabled");
- }
- return Plugin_Handled;
- }
- public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
- {
- if (!Enabled && !IsPlayerAlive(client) && IsClientBot(client)) return Plugin_Continue;
- new rocket = INVALID_ENT_REFERENCE;
- decl Float:fClientEyePosition[3];
- GetClientEyePosition(client, fClientEyePosition);
- while ((rocket = FindEntityByClassname(rocket, "tf_projectile_*")) != INVALID_ENT_REFERENCE)
- {
- decl Float:rocketLocation[3];
- GetEntPropVector(rocket, Prop_Data,"m_vecOrigin",entityLocation);
- decl Float:pos[3];
- GetClientAbsOrigin(client, pos);
- decl Float:angle[3];
- 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))))));
- angle[1] = GetAngle(fClientEyePosition, entityLocation);
- }
- }
- stock bool:IsClientBot(client)
- {
- return client != 0 && IsClientInGame(client) && IsFakeClient(client) && !IsClientReplay(client) && !IsClientSourceTV(client);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement