-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathability_paid_engineer_chatgbt_ability.sp
47 lines (40 loc) · 1.26 KB
/
ability_paid_engineer_chatgbt_ability.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma semicolon 1
#include <sdkhooks>
#include <sourcemod>
#include <tf2_stocks>
#include <tf2attributes>
#include <berobot_constants>
#include <berobot>
#include <tf_custom_attributes>
#include <dhooks>
#include <tf_ontakedamage>
#define ROBOT_NAME "ChatGBT Guardian"
#define PLUGIN_VERSION "1.0"
public Plugin:myinfo =
{
name = "[TF2] ChatGBT on kill firing speed bonus",
author = "HiGPS | Bmod.TF",
description = "ChatGBT guardian ability",
version = PLUGIN_VERSION,
url = "www.sourcemod.com"
}
public OnPluginStart()
{
HookEvent("player_death", Event_Death, EventHookMode_Post);
}
public Event_Death(Event event, const char[] name, bool dontBroadcast)
{
int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
int wepindex = GetEventInt(event, "weapon_def_index");
char weapon_logname[MAX_NAME_LENGTH];
GetEventString(event, "weapon_logclassname", weapon_logname, sizeof(weapon_logname));
if (IsRobot(attacker, ROBOT_NAME) && wepindex == 1153)
{
if (StrContains(weapon_logname, "obj_sentrygun") == -1) // This will account for all obj_sentrygun variations
{
// Applying HASTE rune for faster firing speed
// PrintToChatAll("Adding haste %i", wepindex);
TF2_AddCondition(attacker, TFCond_RuneHaste, 5.0); // 5 seconds duration
}
}
}