|
pred@1964
|
1 |
/** |
|
pred@1964
|
2 |
* vim: set ts=4 : |
|
pred@1964
|
3 |
* ============================================================================= |
|
pred@1964
|
4 |
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. |
|
pred@1964
|
5 |
* ============================================================================= |
|
pred@1964
|
6 |
* |
|
pred@1964
|
7 |
* This file is part of the SourceMod/SourcePawn SDK. |
|
pred@1964
|
8 |
* |
|
pred@1964
|
9 |
* This program is free software; you can redistribute it and/or modify it under |
|
pred@1964
|
10 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
pred@1964
|
11 |
* Free Software Foundation. |
|
pred@1964
|
12 |
* |
|
pred@1964
|
13 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
pred@1964
|
14 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
pred@1964
|
15 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
pred@1964
|
16 |
* details. |
|
pred@1964
|
17 |
* |
|
pred@1964
|
18 |
* You should have received a copy of the GNU General Public License along with |
|
pred@1964
|
19 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
pred@1964
|
20 |
* |
|
pred@1964
|
21 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
pred@1964
|
22 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
pred@1964
|
23 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
pred@1964
|
24 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
pred@1964
|
25 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
pred@1964
|
26 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
pred@1964
|
27 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
pred@1964
|
28 |
* or <http://www.sourcemod.net/license.php>. |
|
pred@1964
|
29 |
* |
|
ds@1987
|
30 |
* Version: $Id$ |
|
pred@1964
|
31 |
*/ |
|
pred@1964
|
32 |
|
|
pred@1963
|
33 |
#if defined _tf2_included |
|
pred@1963
|
34 |
#endinput |
|
pred@1963
|
35 |
#endif |
|
pred@1963
|
36 |
#define _tf2_included |
|
pred@1963
|
37 |
|
|
skamonkey@2943
|
38 |
#define TF_STUNFLAG_SLOWDOWN (1 << 0) // activates slowdown modifier |
|
skamonkey@2943
|
39 |
#define TF_STUNFLAG_BONKSTUCK (1 << 1) // bonk sound, stuck |
|
skamonkey@2943
|
40 |
#define TF_STUNFLAG_LIMITMOVEMENT (1 << 2) // disable forward/backward movement |
|
skamonkey@2943
|
41 |
#define TF_STUNFLAG_CHEERSOUND (1 << 3) // cheering sound |
|
skamonkey@2943
|
42 |
#define TF_STUNFLAG_NOSOUNDOREFFECT (1 << 5) // no sound or particle |
|
skamonkey@2943
|
43 |
#define TF_STUNFLAG_THIRDPERSON (1 << 6) // panic animation |
|
skamonkey@2943
|
44 |
#define TF_STUNFLAG_GHOSTEFFECT (1 << 7) // ghost particles |
|
skamonkey@2943
|
45 |
|
|
skamonkey@2943
|
46 |
#define TF_STUNFLAGS_LOSERSTATE TF_STUNFLAG_SLOWDOWN|TF_STUNFLAG_NOSOUNDOREFFECT|TF_STUNFLAG_THIRDPERSON |
|
skamonkey@2943
|
47 |
#define TF_STUNFLAGS_GHOSTSCARE TF_STUNFLAG_GHOSTEFFECT|TF_STUNFLAG_THIRDPERSON |
|
skamonkey@2943
|
48 |
#define TF_STUNFLAGS_SMALLBONK TF_STUNFLAG_THIRDPERSON|TF_STUNFLAG_SLOWDOWN |
|
skamonkey@2943
|
49 |
#define TF_STUNFLAGS_NORMALBONK TF_STUNFLAG_BONKSTUCK |
|
skamonkey@2943
|
50 |
#define TF_STUNFLAGS_BIGBONK TF_STUNFLAG_CHEERSOUND|TF_STUNFLAG_BONKSTUCK |
|
skamonkey@2943
|
51 |
|
|
pred@1963
|
52 |
enum TFClassType |
|
pred@1963
|
53 |
{ |
|
pred@1963
|
54 |
TFClass_Unknown = 0, |
|
pred@1963
|
55 |
TFClass_Scout, |
|
pred@1963
|
56 |
TFClass_Sniper, |
|
pred@1963
|
57 |
TFClass_Soldier, |
|
pred@1963
|
58 |
TFClass_DemoMan, |
|
pred@1963
|
59 |
TFClass_Medic, |
|
pred@1963
|
60 |
TFClass_Heavy, |
|
pred@1963
|
61 |
TFClass_Pyro, |
|
pred@1963
|
62 |
TFClass_Spy, |
|
pred@1963
|
63 |
TFClass_Engineer |
|
pred@2018
|
64 |
}; |
|
pred@1963
|
65 |
|
|
pred@1963
|
66 |
enum TFTeam |
|
pred@1963
|
67 |
{ |
|
pred@1963
|
68 |
TFTeam_Unassigned = 0, |
|
pred@1963
|
69 |
TFTeam_Spectator = 1, |
|
pred@1963
|
70 |
TFTeam_Red = 2, |
|
pred@1963
|
71 |
TFTeam_Blue = 3 |
|
pred@2018
|
72 |
}; |
|
pred@1963
|
73 |
|
|
skamonkey@2939
|
74 |
enum TFCond |
|
skamonkey@2939
|
75 |
{ |
|
skamonkey@2939
|
76 |
TFCond_Slowed = 0, |
|
skamonkey@2939
|
77 |
TFCond_Zoomed, |
|
skamonkey@2939
|
78 |
TFCond_Disguising, |
|
skamonkey@2939
|
79 |
TFCond_Disguised, |
|
skamonkey@2939
|
80 |
TFCond_Cloaked, |
|
skamonkey@2939
|
81 |
TFCond_Ubercharged, |
|
skamonkey@2939
|
82 |
TFCond_TeleportedGlow, |
|
skamonkey@2939
|
83 |
TFCond_Taunting, |
|
skamonkey@2939
|
84 |
TFCond_UberchargeFading, |
|
skamonkey@2939
|
85 |
TFCond_Unknown1, |
|
skamonkey@2939
|
86 |
TFCond_Teleporting, |
|
skamonkey@2939
|
87 |
TFCond_Kritzkrieged, |
|
skamonkey@2939
|
88 |
TFCond_Unknown2, |
|
skamonkey@2939
|
89 |
TFCond_DeadRingered, |
|
skamonkey@2939
|
90 |
TFCond_Bonked, |
|
skamonkey@2939
|
91 |
TFCond_Dazed, |
|
skamonkey@2939
|
92 |
TFCond_Buffed, |
|
skamonkey@2939
|
93 |
TFCond_Charging, |
|
skamonkey@2939
|
94 |
TFCond_DemoBuff, |
|
skamonkey@3035
|
95 |
TFCond_CritCola, |
|
skamonkey@2939
|
96 |
TFCond_Healing, |
|
skamonkey@3087
|
97 |
|
|
skamonkey@3087
|
98 |
TFCond_OnFire = 22, |
|
skamonkey@2939
|
99 |
TFCond_Overhealed, |
|
skamonkey@3087
|
100 |
TFCond_Jarated, |
|
skamonkey@3125
|
101 |
TFCond_Bleeding, |
|
skamonkey@3125
|
102 |
TFCond_DefenseBuffed, |
|
skamonkey@3125
|
103 |
TFCond_Milked |
|
skamonkey@2942
|
104 |
}; |
|
skamonkey@2939
|
105 |
|
|
skamonkey@3056
|
106 |
enum TFHoliday |
|
skamonkey@3056
|
107 |
{ |
|
skamonkey@3056
|
108 |
TFHoliday_None = 1, |
|
skamonkey@3056
|
109 |
TFHoliday_Halloween, |
|
skamonkey@3056
|
110 |
TFHoliday_Birthday |
|
skamonkey@3056
|
111 |
}; |
|
skamonkey@3056
|
112 |
|
|
erik@3093
|
113 |
enum TFObjectType |
|
erik@3093
|
114 |
{ |
|
erik@3093
|
115 |
TFObject_CartDispenser = 0, |
|
erik@3093
|
116 |
TFObject_Dispenser = 0, |
|
erik@3093
|
117 |
TFObject_Teleporter = 1, |
|
erik@3093
|
118 |
TFObject_Sentry = 2, |
|
erik@3093
|
119 |
TFObject_Sapper = 3 |
|
erik@3093
|
120 |
}; |
|
erik@3093
|
121 |
|
|
erik@3093
|
122 |
enum TFObjectMode |
|
erik@3093
|
123 |
{ |
|
erik@3093
|
124 |
TFObjectMode_None = 0, |
|
erik@3093
|
125 |
TFObjectMode_Entrance = 0, |
|
erik@3093
|
126 |
TFObjectMode_Exit = 1 |
|
erik@3093
|
127 |
}; |
|
erik@3093
|
128 |
|
|
fyrenmoo@2673
|
129 |
/** |
|
fyrenmoo@2673
|
130 |
* Sets a client on fire for 10 seconds. |
|
fyrenmoo@2673
|
131 |
* |
|
fyrenmoo@2673
|
132 |
* @param client Player's index. |
|
fyrenmoo@2673
|
133 |
* @noreturn |
|
fyrenmoo@2673
|
134 |
* @error Invalid client index, client not in game, or no mod support. |
|
fyrenmoo@2673
|
135 |
*/ |
|
fyrenmoo@2673
|
136 |
native TF2_IgnitePlayer(client, target); |
|
pred@1963
|
137 |
|
|
pred@1963
|
138 |
/** |
|
pred@1963
|
139 |
* Respawns a client |
|
pred@1963
|
140 |
* |
|
pred@1963
|
141 |
* @param client Player's index. |
|
pred@1963
|
142 |
* @noreturn |
|
pred@1963
|
143 |
* @error Invalid client index, client not in game, or no mod support. |
|
pred@1963
|
144 |
*/ |
|
pred@1963
|
145 |
native TF2_RespawnPlayer(client); |
|
pred@1963
|
146 |
|
|
pred@1963
|
147 |
/** |
|
skamonkey@2939
|
148 |
* Regenerates a client's health and ammunition |
|
skamonkey@2939
|
149 |
* |
|
skamonkey@2939
|
150 |
* @param client Player's index. |
|
skamonkey@2939
|
151 |
* @noreturn |
|
skamonkey@2939
|
152 |
* @error Invalid client index, client not in game, or no mod support. |
|
skamonkey@2939
|
153 |
*/ |
|
skamonkey@2939
|
154 |
native TF2_RegeneratePlayer(client); |
|
skamonkey@2939
|
155 |
|
|
skamonkey@2939
|
156 |
/** |
|
skamonkey@2939
|
157 |
* Adds a condition to a player |
|
skamonkey@2939
|
158 |
* |
|
skamonkey@2939
|
159 |
* @param client Player's index. |
|
skamonkey@2939
|
160 |
* @param condition Integer identifier of condition to apply. |
|
skamonkey@2939
|
161 |
* @param duration Duration of condition (does not apply to all conditions). |
|
skamonkey@2939
|
162 |
* @noreturn |
|
skamonkey@2939
|
163 |
* @error Invalid client index, client not in game, or no mod support. |
|
skamonkey@2939
|
164 |
*/ |
|
skamonkey@2939
|
165 |
native TF2_AddCondition(client, TFCond:condition, Float:duration); |
|
skamonkey@2939
|
166 |
|
|
skamonkey@2939
|
167 |
/** |
|
skamonkey@2939
|
168 |
* Removes a condition from a player |
|
skamonkey@2939
|
169 |
* |
|
skamonkey@2939
|
170 |
* @param client Player's index. |
|
skamonkey@2939
|
171 |
* @param condition Integer identifier of condition to remove. |
|
skamonkey@2939
|
172 |
* @noreturn |
|
skamonkey@2939
|
173 |
* @error Invalid client index, client not in game, or no mod support. |
|
skamonkey@2939
|
174 |
*/ |
|
skamonkey@2939
|
175 |
native TF2_RemoveCondition(client, TFCond:condition); |
|
skamonkey@2939
|
176 |
|
|
skamonkey@2939
|
177 |
/** |
|
skamonkey@2939
|
178 |
* Enables/disables PowerPlay mode on a player. |
|
skamonkey@2939
|
179 |
* |
|
skamonkey@2939
|
180 |
* @param client Player's index. |
|
skamonkey@2939
|
181 |
* @param enabled Whether to enable or disable PowerPlay on player. |
|
skamonkey@2939
|
182 |
* @noreturn |
|
skamonkey@2939
|
183 |
* @error Invalid client index, client not in game, or no mod support. |
|
skamonkey@2939
|
184 |
*/ |
|
skamonkey@2939
|
185 |
native TF2_SetPlayerPowerPlay(client, bool:enabled); |
|
skamonkey@2939
|
186 |
|
|
skamonkey@2939
|
187 |
/** |
|
pred@1963
|
188 |
* Disguises a client to the given model and team. Only has an effect on spies. |
|
pred@1963
|
189 |
* |
|
pred@1963
|
190 |
* Note: This only starts the disguise process and a delay occurs before the spy is fully disguised |
|
pred@1963
|
191 |
* |
|
pred@1963
|
192 |
* @param client Player's index. |
|
pred@1963
|
193 |
* @param team Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect) |
|
pred@1963
|
194 |
* @param class TFClassType class to disguise the player as |
|
skamonkey@3128
|
195 |
* @param target Specific target player to disguise as (0 for any) |
|
pred@1963
|
196 |
* @noreturn |
|
pred@1963
|
197 |
* @error Invalid client index, client not in game, or no mod support. |
|
pred@1963
|
198 |
*/ |
|
skamonkey@3128
|
199 |
native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class, target=0); |
|
pred@1963
|
200 |
|
|
pred@1963
|
201 |
/** |
|
pred@1963
|
202 |
* Removes the current disguise from a client. Only has an effect on spies. |
|
pred@1963
|
203 |
* |
|
pred@1963
|
204 |
* @param client Player's index. |
|
pred@1963
|
205 |
* @noreturn |
|
pred@1963
|
206 |
* @error Invalid client index, client not in game, or no mod support. |
|
pred@1963
|
207 |
*/ |
|
pred@1963
|
208 |
native TF2_RemovePlayerDisguise(client); |
|
pred@1963
|
209 |
|
|
pred@1963
|
210 |
/** |
|
skamonkey@2943
|
211 |
* Stuns a client |
|
skamonkey@2943
|
212 |
* |
|
skamonkey@2943
|
213 |
* @param client Player's index. |
|
skamonkey@2943
|
214 |
* @param float Duration of stun. |
|
skamonkey@2943
|
215 |
* @param float Slowdown percent (as decimal, 0.00-1.00) |
|
skamonkey@2943
|
216 |
* (ignored if TF_STUNFLAG_SLOWDOWN is not set. |
|
skamonkey@2943
|
217 |
* @param int Stun flags. |
|
skamonkey@2943
|
218 |
* @param attacker Attacker's index (0 is allowed for world). |
|
skamonkey@2943
|
219 |
* @noreturn |
|
skamonkey@2943
|
220 |
*/ |
|
skamonkey@2943
|
221 |
native TF2_StunPlayer(client, Float:duration, Float:slowdown=0.0, stunflags, attacker=0); |
|
skamonkey@2943
|
222 |
|
|
skamonkey@2943
|
223 |
/** |
|
abkowald@3096
|
224 |
* Induces the bleed effect on a client |
|
abkowald@3096
|
225 |
* |
|
abkowald@3096
|
226 |
* @param client Player's index. |
|
abkowald@3096
|
227 |
* @param victim Victim's index. |
|
abkowald@3096
|
228 |
* @param float Duration of bleeding (in seconds). |
|
abkowald@3096
|
229 |
* @noreturn |
|
abkowald@3096
|
230 |
*/ |
|
abkowald@3096
|
231 |
native TF2_MakeBleed(client, victim, Float:duration); |
|
abkowald@3096
|
232 |
|
|
abkowald@3096
|
233 |
/** |
|
pred@1963
|
234 |
* Retrieves the entity index of the CPlayerResource entity |
|
pred@1963
|
235 |
* |
|
pred@1963
|
236 |
* @return The current resource entity index. |
|
pred@1963
|
237 |
*/ |
|
pred@1963
|
238 |
native TF2_GetResourceEntity(); |
|
pred@1963
|
239 |
|
|
pred@1963
|
240 |
/** |
|
pred@1963
|
241 |
* Finds the TFClassType for a given class name. |
|
pred@1963
|
242 |
* |
|
pred@1963
|
243 |
* @param classname A classname string such as "sniper" or "demoman" |
|
pred@1963
|
244 |
* @return A TFClassType constant. |
|
pred@1963
|
245 |
*/ |
|
pred@1963
|
246 |
native TFClassType:TF2_GetClass(const String:classname[]); |
|
pred@1963
|
247 |
|
|
pred@1963
|
248 |
/** |
|
pred@1979
|
249 |
* Called on weapon fire to decide if the current shot should be critical. |
|
pred@1979
|
250 |
* Return Plugin_Continue to let the original calculation or return a higher |
|
pred@1979
|
251 |
* action to override the decision with the value of 'result' |
|
pred@1979
|
252 |
* |
|
pred@1979
|
253 |
* @note Since critical shots are also calculated client side any changes made with |
|
pred@1979
|
254 |
* this will not show for the shooter. Projectile weapons such as the rocketlauncher |
|
pred@1979
|
255 |
* and demoman weapons will show a critical bullet but no critical sound effect. |
|
pred@1979
|
256 |
* Bullet hits should appear as expected. |
|
pred@1979
|
257 |
* |
|
pred@1979
|
258 |
* @param client Client Index. |
|
pred@1979
|
259 |
* @param weapon Weapon entity Index. |
|
pred@1979
|
260 |
* @param weaponname Classname of the weapon. |
|
pred@1979
|
261 |
* @param result Buffer param for the result of the decision. |
|
pred@1979
|
262 |
*/ |
|
pred@1981
|
263 |
forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result); |
|
pred@1979
|
264 |
|
|
pred@1979
|
265 |
/** |
|
skamonkey@3056
|
266 |
* Called when the game checks to see if the current day is one of its tracked holidays |
|
skamonkey@3056
|
267 |
* |
|
skamonkey@3056
|
268 |
* @note Change the value of holiday and return Plugin_Changed to override. |
|
skamonkey@3056
|
269 |
* Return Plugin_Continue for no change. |
|
skamonkey@3056
|
270 |
* |
|
skamonkey@3056
|
271 |
* @param holiday Current Holiday |
|
skamonkey@3056
|
272 |
*/ |
|
skamonkey@3056
|
273 |
forward Action:TF2_OnGetHoliday(&TFHoliday:holiday); |
|
skamonkey@3056
|
274 |
|
|
skamonkey@3056
|
275 |
/** |
|
pred@1963
|
276 |
* Do not edit below this line! |
|
pred@1963
|
277 |
*/ |
|
pred@1963
|
278 |
public Extension:__ext_tf2 = |
|
pred@1963
|
279 |
{ |
|
pred@1963
|
280 |
name = "TF2 Tools", |
|
pred@1963
|
281 |
file = "game.tf2.ext", |
|
skamonkey@3028
|
282 |
autoload = 0, |
|
pred@1963
|
283 |
#if defined REQUIRE_EXTENSIONS |
|
pred@1963
|
284 |
required = 1, |
|
pred@1963
|
285 |
#else |
|
pred@1963
|
286 |
required = 0, |
|
pred@1963
|
287 |
#endif |
|
pred@1963
|
288 |
}; |
|
skamonkey@2976
|
289 |
|
|
skamonkey@2976
|
290 |
#if !defined REQUIRE_EXTENSIONS |
|
skamonkey@2976
|
291 |
public __ext_tf2_SetNTVOptional() |
|
skamonkey@2976
|
292 |
{ |
|
skamonkey@2976
|
293 |
MarkNativeAsOptional("TF2_IgnitePlayer"); |
|
skamonkey@2976
|
294 |
MarkNativeAsOptional("TF2_RespawnPlayer"); |
|
skamonkey@2976
|
295 |
MarkNativeAsOptional("TF2_RegeneratePlayer"); |
|
skamonkey@2976
|
296 |
MarkNativeAsOptional("TF2_AddCondition"); |
|
skamonkey@2976
|
297 |
MarkNativeAsOptional("TF2_RemoveCondition"); |
|
skamonkey@2976
|
298 |
MarkNativeAsOptional("TF2_SetPlayerPowerPlay"); |
|
skamonkey@2976
|
299 |
MarkNativeAsOptional("TF2_DisguisePlayer"); |
|
skamonkey@2976
|
300 |
MarkNativeAsOptional("TF2_RemovePlayerDisguise"); |
|
skamonkey@2976
|
301 |
MarkNativeAsOptional("TF2_StunPlayer"); |
|
skamonkey@3110
|
302 |
MarkNativeAsOptional("TF2_MakeBleed"); |
|
skamonkey@2976
|
303 |
MarkNativeAsOptional("TF2_GetResourceEntity"); |
|
skamonkey@2976
|
304 |
MarkNativeAsOptional("TF2_GetClass"); |
|
skamonkey@2976
|
305 |
} |
|
skamonkey@2976
|
306 |
#endif |