-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathability_boss_demoman_smoker_ability.sp
71 lines (56 loc) · 1.59 KB
/
ability_boss_demoman_smoker_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
64
65
66
67
68
69
70
71
#pragma semicolon 1
#include <sourcemod>
#include <tf2_stocks>
#include <tf2attributes>
#include <berobot_constants>
#include <berobot>
#include <sdkhooks>
#include <tf_custom_attributes>
#define PLUGIN_VERSION "1.0"
#define ROBOT_NAME "Smoker"
#define BLU_MODEL "models/props_trainyard/bomb_cart.mdl"
#define RED_MODEL "models/props_trainyard/bomb_cart_red.mdl"
// #define PMODEL "models/props_td/atom_bomb.mdl"
int g_iTeam;
public Plugin:myinfo =
{
name = "[TF2] Nuker Payload Model Swap",
author = "HiGPS | Bmod.TF",
description = "Nuker payload model swap",
version = PLUGIN_VERSION,
url = "www.sourcemod.com"
}
public OnMapStart()
{
PrecacheModel(RED_MODEL);
PrecacheModel(BLU_MODEL);
}
public void OnEntityCreated(int iEntity, const char[] sClassName)
{
if (StrContains(sClassName, "tf_projectile") == 0)
{
SDKHook(iEntity, SDKHook_Spawn, Hook_OnProjectileSpawn);
}
}
public void Hook_OnProjectileSpawn(iEntity) {
int iClient = GetEntPropEnt(iEntity, Prop_Data, "m_hOwnerEntity");
if (0 < iClient && iClient <= MaxClients && IsRobot(iClient, ROBOT_NAME)) {
// SetEntPropFloat(iEntity, Prop_Send, "m_flModelScale", 1.75);
g_iTeam = GetClientTeam(iClient);
RequestFrame(SetProjectileModel, iEntity);
}
}
float g_fStockvecMin[3] = {-10.0, -10.0, -10.0};
float g_fStockvecMax[3] = {10.0, 10.0, 10.0};
void SetProjectileModel (int iEntity)
{
if(g_iTeam == 2)
{
SetEntityModel(iEntity, RED_MODEL);
}else
{
SetEntityModel(iEntity, BLU_MODEL);
}
SetEntPropVector(iEntity, Prop_Send, "m_vecMins", g_fStockvecMin);
SetEntPropVector(iEntity, Prop_Send, "m_vecMaxs", g_fStockvecMax);
}