plugins/include/tf2.inc
author Ruben Gonzalez <drifter01620@gmail.com>
Thu May 22 09:49:27 2014 -0400 (2014-05-22)
changeset 4378 568f4497ef4a
parent 4316 c0ffa3405ecd
permissions -rw-r--r--
Update CS:GO team score gamedata.
     1 /**
     2  * vim: set ts=4 :
     3  * =============================================================================
     4  * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
     5  * =============================================================================
     6  *
     7  * This file is part of the SourceMod/SourcePawn SDK.
     8  *
     9  * This program is free software; you can redistribute it and/or modify it under
    10  * the terms of the GNU General Public License, version 3.0, as published by the
    11  * Free Software Foundation.
    12  * 
    13  * This program is distributed in the hope that it will be useful, but WITHOUT
    14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    15  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    16  * details.
    17  *
    18  * You should have received a copy of the GNU General Public License along with
    19  * this program.  If not, see <http://www.gnu.org/licenses/>.
    20  *
    21  * As a special exception, AlliedModders LLC gives you permission to link the
    22  * code of this program (as well as its derivative works) to "Half-Life 2," the
    23  * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
    24  * by the Valve Corporation.  You must obey the GNU General Public License in
    25  * all respects for all other code used.  Additionally, AlliedModders LLC grants
    26  * this exception to all derivative works.  AlliedModders LLC defines further
    27  * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
    28  * or <http://www.sourcemod.net/license.php>.
    29  *
    30  * Version: $Id$
    31  */
    32 
    33 #if defined _tf2_included
    34  #endinput
    35 #endif
    36 #define _tf2_included
    37 
    38 #define TF_STUNFLAG_SLOWDOWN        (1 << 0)	/**< activates slowdown modifier */
    39 #define TF_STUNFLAG_BONKSTUCK       (1 << 1)	/**< bonk sound, stuck */
    40 #define TF_STUNFLAG_LIMITMOVEMENT   (1 << 2)	/**< disable forward/backward movement */
    41 #define TF_STUNFLAG_CHEERSOUND      (1 << 3)	/**< cheering sound */
    42 #define TF_STUNFLAG_NOSOUNDOREFFECT (1 << 5)	/**< no sound or particle */
    43 #define TF_STUNFLAG_THIRDPERSON     (1 << 6)	/**< panic animation */
    44 #define TF_STUNFLAG_GHOSTEFFECT     (1 << 7)	/**< ghost particles */
    45 
    46 #define TF_STUNFLAGS_LOSERSTATE     TF_STUNFLAG_SLOWDOWN|TF_STUNFLAG_NOSOUNDOREFFECT|TF_STUNFLAG_THIRDPERSON
    47 #define TF_STUNFLAGS_GHOSTSCARE     TF_STUNFLAG_GHOSTEFFECT|TF_STUNFLAG_THIRDPERSON
    48 #define TF_STUNFLAGS_SMALLBONK      TF_STUNFLAG_THIRDPERSON|TF_STUNFLAG_SLOWDOWN
    49 #define TF_STUNFLAGS_NORMALBONK     TF_STUNFLAG_BONKSTUCK
    50 #define TF_STUNFLAGS_BIGBONK        TF_STUNFLAG_CHEERSOUND|TF_STUNFLAG_BONKSTUCK
    51 
    52 enum TFClassType
    53 {
    54 	TFClass_Unknown = 0,
    55 	TFClass_Scout,
    56 	TFClass_Sniper,
    57 	TFClass_Soldier,
    58 	TFClass_DemoMan,
    59 	TFClass_Medic,
    60 	TFClass_Heavy,
    61 	TFClass_Pyro,
    62 	TFClass_Spy,
    63 	TFClass_Engineer
    64 };
    65 
    66 enum TFTeam
    67 {
    68 	TFTeam_Unassigned = 0,
    69 	TFTeam_Spectator = 1,
    70 	TFTeam_Red = 2,
    71 	TFTeam_Blue = 3	
    72 };
    73 
    74 enum TFCond
    75 {
    76 	TFCond_Slowed = 0,
    77 	TFCond_Zoomed,
    78 	TFCond_Disguising,
    79 	TFCond_Disguised,
    80 	TFCond_Cloaked,
    81 	TFCond_Ubercharged,
    82 	TFCond_TeleportedGlow,
    83 	TFCond_Taunting,
    84 	TFCond_UberchargeFading,
    85 	TFCond_Unknown1, //9
    86 	TFCond_CloakFlicker = 9,
    87 	TFCond_Teleporting,
    88 	TFCond_Kritzkrieged,
    89 	TFCond_Unknown2, //12
    90 	TFCond_TmpDamageBonus = 12,
    91 	TFCond_DeadRingered,
    92 	TFCond_Bonked,
    93 	TFCond_Dazed,
    94 	TFCond_Buffed,
    95 	TFCond_Charging,
    96 	TFCond_DemoBuff,
    97 	TFCond_CritCola,
    98 	TFCond_InHealRadius,
    99 	TFCond_Healing,
   100 	TFCond_OnFire,
   101 	TFCond_Overhealed,
   102 	TFCond_Jarated,
   103 	TFCond_Bleeding,
   104 	TFCond_DefenseBuffed,
   105 	TFCond_Milked,
   106 	TFCond_MegaHeal,
   107 	TFCond_RegenBuffed,
   108 	TFCond_MarkedForDeath,
   109 	TFCond_NoHealingDamageBuff,
   110 	TFCond_SpeedBuffAlly,		//32
   111 	TFCond_HalloweenCritCandy,
   112 	TFCond_CritCanteen,
   113 	TFCond_CritDemoCharge,
   114 	TFCond_CritHype,
   115 	TFCond_CritOnFirstBlood,
   116 	TFCond_CritOnWin,
   117 	TFCond_CritOnFlagCapture,
   118 	TFCond_CritOnKill,
   119 	TFCond_RestrictToMelee,
   120 	TFCond_DefenseBuffNoCritBlock,
   121 	TFCond_Reprogrammed,
   122 	TFCond_CritMmmph,
   123 	TFCond_DefenseBuffMmmph,
   124 	TFCond_FocusBuff,
   125 	TFCond_DisguiseRemoved,
   126 	TFCond_MarkedForDeathSilent,
   127 	TFCond_DisguisedAsDispenser,
   128 	TFCond_Sapped,
   129 	TFCond_UberchargedHidden,
   130 	TFCond_UberchargedCanteen,
   131 	TFCond_HalloweenBombHead,
   132 	TFCond_HalloweenThriller,
   133 	TFCond_RadiusHealOnDamage,
   134 	TFCond_CritOnDamage,
   135 	TFCond_UberchargedOnTakeDamage,
   136 	TFCond_UberBulletResist,
   137 	TFCond_UberBlastResist,
   138 	TFCond_UberFireResist,
   139 	TFCond_SmallBulletResist,
   140 	TFCond_SmallBlastResist,
   141 	TFCond_SmallFireResist,
   142 	TFCond_Stealthed, // 64
   143 	TFCond_MedigunDebuff,
   144 	TFCond_StealthedUserBuffFade,
   145 	TFCond_BulletImmune,
   146 	TFCond_BlastImmune,
   147 	TFCond_FireImmune,
   148 	TFCond_PreventDeath,
   149 	TFCond_MVMBotRadiowave,
   150 	TFCond_HalloweenSpeedBoost,
   151 	TFCond_HalloweenQuickHeal,
   152 	TFCond_HalloweenGiant,
   153 	TFCond_HalloweenTiny,
   154 	TFCond_HalloweenInHell,
   155 	TFCond_HalloweenGhostMode,
   156 };
   157 
   158 const Float:TFCondDuration_Infinite = -1.0;
   159 
   160 enum TFHoliday
   161 {
   162 	TFHoliday_Birthday = 1,
   163 	TFHoliday_Halloween,
   164 	TFHoliday_Christmas,
   165 	TFHoliday_ValentinesDay,
   166 	TFHoliday_MeetThePyro,
   167 	TFHoliday_FullMoon,
   168 	TFHoliday_HalloweenOrFullMoon,
   169 	TFHoliday_HalloweenOrFullMoonOrValentines,
   170 	TFHoliday_AprilFools,
   171 };
   172 
   173 enum TFObjectType
   174 {
   175 	TFObject_CartDispenser = 0,
   176 	TFObject_Dispenser = 0,
   177 	TFObject_Teleporter = 1,
   178 	TFObject_Sentry = 2,
   179 	TFObject_Sapper = 3
   180 };
   181 
   182 enum TFObjectMode
   183 {
   184 	TFObjectMode_None = 0,
   185 	TFObjectMode_Entrance = 0,
   186 	TFObjectMode_Exit = 1
   187 };
   188 
   189 /**
   190  * Sets a client on fire for 10 seconds.
   191  *
   192  * @param client		Player's index.
   193  * @param attacker		Attacker's index.
   194  * @noreturn
   195  * @error				Invalid client index, client not in game, or no mod support.
   196  */
   197 native TF2_IgnitePlayer(client, attacker);
   198 
   199 /**
   200  * Respawns a client
   201  *
   202  * @param client		Player's index.
   203  * @noreturn
   204  * @error				Invalid client index, client not in game, or no mod support.
   205  */
   206 native TF2_RespawnPlayer(client);
   207 
   208 /**
   209  * Regenerates a client's health and ammunition
   210  *
   211  * @param client		Player's index.
   212  * @noreturn
   213  * @error				Invalid client index, client not in game, or no mod support.
   214  */
   215 native TF2_RegeneratePlayer(client);
   216 
   217 /**
   218  * Adds a condition to a player
   219  *
   220  * @param client		Player's index.
   221  * @param condition		Integer identifier of condition to apply.
   222  * @param duration		Duration of condition (does not apply to all conditions).
   223  *                      Pass TFCondDuration_Infinite to apply until manually removed.
   224  * @param inflictor		Condition inflictor's index (0 for no inflictor).
   225  * @noreturn
   226  * @error				Invalid client index, client not in game, or no mod support.
   227  */
   228 native TF2_AddCondition(client, TFCond:condition, Float:duration=TFCondDuration_Infinite, inflictor=0);
   229 
   230 /**
   231  * Removes a condition from a player
   232  *
   233  * @param client		Player's index.
   234  * @param condition		Integer identifier of condition to remove.
   235  * @noreturn
   236  * @error				Invalid client index, client not in game, or no mod support.
   237  */
   238 native TF2_RemoveCondition(client, TFCond:condition);
   239 
   240 /**
   241  * Enables/disables PowerPlay mode on a player.
   242  *
   243  * @param client		Player's index.
   244  * @param enabled		Whether to enable or disable PowerPlay on player.
   245  * @noreturn
   246  * @error				Invalid client index, client not in game, or no mod support.
   247  */
   248 native TF2_SetPlayerPowerPlay(client, bool:enabled);
   249 
   250 /**
   251  * Disguises a client to the given model and team. Only has an effect on spies.
   252  *
   253  * Note: This only starts the disguise process and a delay occurs before the spy is fully disguised
   254  *
   255  * @param client		Player's index.
   256  * @param team			Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
   257  * @param class			TFClassType class to disguise the player as
   258  * @param target		Specific target player to disguise as (0 for any)
   259  * @noreturn
   260  * @error				Invalid client index, client not in game, or no mod support.
   261  */
   262 native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class, target=0);
   263 
   264 /**
   265  * Removes the current disguise from a client. Only has an effect on spies.
   266  *
   267  * @param client		Player's index.
   268  * @noreturn
   269  * @error				Invalid client index, client not in game, or no mod support.
   270  */
   271 native TF2_RemovePlayerDisguise(client);
   272 
   273 /**
   274  * Stuns a client
   275  *
   276  * @param client		Player's index.
   277  * @param duration		Duration of stun.
   278  * @param slowdown		Slowdown percent (as decimal, 0.00-1.00)
   279  *						Ignored if TF_STUNFLAG_SLOWDOWN is not set.
   280  * @param stunflags		Stun flags.
   281  * @param attacker		Attacker's index (0 is allowed for world).
   282  * @noreturn
   283  */
   284 native TF2_StunPlayer(client, Float:duration, Float:slowdown=0.0, stunflags, attacker=0);
   285 
   286 /**
   287  * Induces the bleed effect on a client
   288  *
   289  * @param client		Player's index.
   290  * @param attacker		Attacker's index.
   291  * @param duration		Duration of bleeding (in seconds).
   292  * @noreturn
   293  */
   294 native TF2_MakeBleed(client, attacker, Float:duration);
   295 
   296 /**
   297  * Retrieves the entity index of the CPlayerResource entity
   298  *
   299  * @return				The current resource entity index.
   300  */
   301 #pragma deprecated Use GetPlayerResourceEntity instead
   302 native TF2_GetResourceEntity();
   303 
   304 /**
   305  * Finds the TFClassType for a given class name.
   306  *
   307  * @param classname		A classname string such as "sniper" or "demoman"
   308  * @return				A TFClassType constant.
   309  */
   310 native TFClassType:TF2_GetClass(const String:classname[]);
   311 
   312 /**
   313  * Called on weapon fire to decide if the current shot should be critical.
   314  * Return Plugin_Continue to let the original calculation or return a higher
   315  * action to override the decision with the value of 'result'
   316  *
   317  * @note Since critical shots are also calculated client side any changes made with
   318  *		 this will not show for the shooter. Projectile weapons such as the rocketlauncher
   319  *		 and demoman weapons will show a critical bullet but no critical sound effect.
   320  *		 Bullet hits should appear as expected.
   321  *
   322  * @param client		Client Index.
   323  * @param weapon		Weapon entity Index.
   324  * @param weaponname	Classname of the weapon.
   325  * @param result		Buffer param for the result of the decision.
   326  */
   327 forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result);
   328 
   329 /**
   330  * @deprecated		No longer called. Use TF2_OnIsHolidayActive.
   331  */
   332 #pragma deprecated No longer called. Use TF2_OnIsHolidayActive.
   333 forward Action:TF2_OnGetHoliday(&TFHoliday:holiday);
   334 
   335 /**
   336  * Called at various times when the game checks to see if the given holiday is active.
   337  * Return Plugin_Continue to let the original calculation or return a higher
   338  * action to override the decision with the value of 'result'
   339  *
   340  * @param holiday		Holiday being checked.
   341  * @param result		Buffer param for the result of the decision.
   342  * @return				Plugin_Continue for original calculation, higher value to use 'result'.
   343  */
   344 forward Action:TF2_OnIsHolidayActive(TFHoliday:holiday, &bool:result);
   345 
   346 /**
   347  * Returns whether or not a holiday is active
   348  *
   349  * @param holiday		Holiday being checked.
   350  * @return				Boolean of whether or not the holiday is active.
   351  */
   352 native bool:TF2_IsHolidayActive(TFHoliday:holiday);
   353 
   354 /**
   355  * Returns whether or not a client (Player) is in a duel.
   356  *
   357  * @param client    Client Index.
   358  * @return          Boolean of whether or not the client/player is dueling.
   359  */
   360 native bool:TF2_IsPlayerInDuel(client);
   361 
   362 /**
   363  * Called after a condition is added to a player
   364  *
   365  * @param client		Index of the client to which the conditon is being added.
   366  * @param condition     Condition that is being added.
   367  * @noreturn
   368  */
   369 forward TF2_OnConditionAdded(client, TFCond:condition);
   370 
   371 /**
   372  * Called after a condition is removed from a player
   373  *
   374  * @param client		Index of the client to which the condition is being removed.
   375  * @param condition		Condition that is being removed.
   376  * @noreturn
   377  */
   378 forward TF2_OnConditionRemoved(client, TFCond:condition);
   379 
   380 /**
   381  * Called when the server enters the Waiting for Players round state
   382  *
   383  * @noreturn
   384  */
   385 forward TF2_OnWaitingForPlayersStart();
   386 
   387 /**
   388  * Called when the server exits the Waiting for Players round state
   389  *
   390  * @noreturn
   391  */
   392 forward TF2_OnWaitingForPlayersEnd();
   393 
   394 /**
   395  * Called when a player attempts to use a teleporter to decide if the player should be allowed to teleport.
   396  * Return Plugin_Continue to let the original calculation or return a higher
   397  * action to override the decision with the value of 'result'
   398  *
   399  * @param client		Client index.
   400  * @param teleporter	Teleporter entity index.
   401  * @param result		Buffer param for the result of the decision.
   402  *						This is prepopulated with the game's original decision to let a player teleport.
   403  * @return				Plugin_Continue for original calculation, higher value to use 'result'.
   404  */
   405 forward Action:TF2_OnPlayerTeleport(client, teleporter, &bool:result);
   406  
   407 /**
   408  * Do not edit below this line!
   409  */
   410 public Extension:__ext_tf2 = 
   411 {
   412 	name = "TF2 Tools",
   413 	file = "game.tf2.ext",
   414 	autoload = 0,
   415 #if defined REQUIRE_EXTENSIONS
   416 	required = 1,
   417 #else
   418 	required = 0,
   419 #endif
   420 };
   421 
   422 #if !defined REQUIRE_EXTENSIONS
   423 public __ext_tf2_SetNTVOptional()
   424 {
   425 	MarkNativeAsOptional("TF2_IgnitePlayer");
   426 	MarkNativeAsOptional("TF2_RespawnPlayer");
   427 	MarkNativeAsOptional("TF2_RegeneratePlayer");
   428 	MarkNativeAsOptional("TF2_AddCondition");
   429 	MarkNativeAsOptional("TF2_RemoveCondition");
   430 	MarkNativeAsOptional("TF2_SetPlayerPowerPlay");
   431 	MarkNativeAsOptional("TF2_DisguisePlayer");
   432 	MarkNativeAsOptional("TF2_RemovePlayerDisguise");
   433 	MarkNativeAsOptional("TF2_StunPlayer");
   434 	MarkNativeAsOptional("TF2_MakeBleed");
   435 	MarkNativeAsOptional("TF2_GetResourceEntity");
   436 	MarkNativeAsOptional("TF2_GetClass");
   437 	MarkNativeAsOptional("TF2_IsPlayerInDuel");
   438 	MarkNativeAsOptional("TF2_IsHolidayActive");
   439 }
   440 #endif