-
Notifications
You must be signed in to change notification settings - Fork 7
/
ability_paid_spy_blackshiv_ability.sp
63 lines (51 loc) · 1.32 KB
/
ability_paid_spy_blackshiv_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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma semicolon 1
#include <sourcemod>
#include <tf2_stocks>
#include <tf2attributes>
#include <sdkhooks>
#include <berobot_constants>
#include <berobot>
#include <dhooks>
#include <tf_ontakedamage.inc>
#define PLUGIN_VERSION "1.0"
#define ROBOT_NAME "Black Shiv"
bool g_PressedButton[MAXPLAYERS + 1] = {false, ...};
public Plugin:myinfo =
{
name = "[TF2] BlackShiv Ability",
author = "HiGPS | Bmod.TF",
description = "BlackShiv Ability",
version = PLUGIN_VERSION,
url = "www.sourcemod.com"
}
//bool g_bisGSPY[MAXPLAYERS + 1];
public OnPluginStart()
{
LoadTranslations("common.phrases");
}
public void OnPluginEnd()
{
RemoveRobot(ROBOT_NAME);
}
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
return APLRes_Success;
}
public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2])
{
if (IsRobot(client, ROBOT_NAME) && buttons & (IN_ATTACK3|IN_USE))
{
if (!g_PressedButton[client])
{
FakeClientCommand(client, "use tf_weapon_grapplinghook");
CreateTimer(1.0, Timer_Button, client);
}
g_PressedButton[client] = true;
}
return Plugin_Continue;
}
public Action Timer_Button(Handle timer, any client)
{
g_PressedButton[client] = false;
return Plugin_Continue;
}