-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathability_paid_engineer_sniper_sentry_ability.sp
52 lines (43 loc) · 1.38 KB
/
ability_paid_engineer_sniper_sentry_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
#include <sourcemod>
#include <tf2_stocks>
#include <berobot_constants>
#include <berobot>
#include <tf_ontakedamage>
#define ROBOT_NAME "Engiper"
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "Sentry Self Stun",
author = "HiGPS",
description = "Sentry disable self on it, made for sniper sentry",
version = "1.0",
url = "http://bmod.tf"
}
public Action TF2_OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3], int damagecustom, CritType &critType)
{
// if (!g_Enable)
// return Plugin_Continue;
if(!IsValidClient(victim))
return Plugin_Continue;
if(!IsValidClient(attacker))
return Plugin_Continue;
//This is sentry fire
if (damagetype == 2232322 && weapon == -1 && IsRobot(attacker, ROBOT_NAME))
{
//RemoveEntity(inflictor);
RequestFrame(PerformSap, inflictor);
PrintToChatAll("attacker: %N, Dmgtype %i: inflictor: %i, weapon: %i",attacker, damagetype, inflictor, weapon);
}
return Plugin_Continue;
}
stock void PerformSap(int entity)
{
// SetVariantInt(2);
// AcceptEntityInput(entity, "RemoveHealth");
SetEntProp(entity, Prop_Send, "m_bDisabled", 1);
CreateTimer(1.0, PerformUnSap, entity);
}
public Action PerformUnSap(Handle timer, int entity)
{
if(IsValidEntity(entity))SetEntProp(entity, Prop_Send, "m_bDisabled", 0);
}