plugins/include/tf2.inc
author Nicholas Hastings <skamonkey@gmail.com>
Mon Feb 08 19:57:20 2010 -0800 (2010-02-08)
changeset 2914 bf5f9aa53abe
parent 2673 87d4d9f3cbc3
child 2939 3d62874b9071
permissions -rw-r--r--
Fixed FindEntityByClassname crash in Synergy (bug 4235, r=dvander).
     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 enum TFClassType
    39 {
    40 	TFClass_Unknown = 0,
    41 	TFClass_Scout,
    42 	TFClass_Sniper,
    43 	TFClass_Soldier,
    44 	TFClass_DemoMan,
    45 	TFClass_Medic,
    46 	TFClass_Heavy,
    47 	TFClass_Pyro,
    48 	TFClass_Spy,
    49 	TFClass_Engineer
    50 };
    51 
    52 enum TFTeam
    53 {
    54 	TFTeam_Unassigned = 0,
    55 	TFTeam_Spectator = 1,
    56 	TFTeam_Red = 2,
    57 	TFTeam_Blue = 3	
    58 };
    59 
    60 /**
    61  * Sets a client on fire for 10 seconds.
    62  *
    63  * @param client		Player's index.
    64  * @noreturn
    65  * @error				Invalid client index, client not in game, or no mod support.
    66  */
    67 native TF2_IgnitePlayer(client, target);
    68 
    69 /**
    70  * Respawns a client
    71  *
    72  * @param client		Player's index.
    73  * @noreturn
    74  * @error				Invalid client index, client not in game, or no mod support.
    75  */
    76 native TF2_RespawnPlayer(client);
    77 
    78 /**
    79  * Disguises a client to the given model and team. Only has an effect on spies.
    80  *
    81  * Note: This only starts the disguise process and a delay occurs before the spy is fully disguised
    82  *
    83  * @param client		Player's index.
    84  * @param team			Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
    85  * @param class			TFClassType class to disguise the player as
    86  * @noreturn
    87  * @error				Invalid client index, client not in game, or no mod support.
    88  */
    89 native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class);
    90 
    91 /**
    92  * Removes the current disguise from a client. Only has an effect on spies.
    93  *
    94  * @param client		Player's index.
    95  * @noreturn
    96  * @error				Invalid client index, client not in game, or no mod support.
    97  */
    98 native TF2_RemovePlayerDisguise(client);
    99 
   100 /**
   101  * Retrieves the entity index of the CPlayerResource entity
   102  *
   103  * @return				The current resource entity index.
   104  */
   105 native TF2_GetResourceEntity();
   106 
   107 /**
   108  * Finds the TFClassType for a given class name.
   109  *
   110  * @param classname		A classname string such as "sniper" or "demoman"
   111  * @return				A TFClassType constant.
   112  */
   113 native TFClassType:TF2_GetClass(const String:classname[]);
   114 
   115 /**
   116  * Called on weapon fire to decide if the current shot should be critical.
   117  * Return Plugin_Continue to let the original calculation or return a higher
   118  * action to override the decision with the value of 'result'
   119  *
   120  * @note Since critical shots are also calculated client side any changes made with
   121  *		 this will not show for the shooter. Projectile weapons such as the rocketlauncher
   122  *		 and demoman weapons will show a critical bullet but no critical sound effect.
   123  *		 Bullet hits should appear as expected.
   124  *
   125  * @param client		Client Index.
   126  * @param weapon		Weapon entity Index.
   127  * @param weaponname	Classname of the weapon.
   128  * @param result		Buffer param for the result of the decision.
   129  */
   130 forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result);
   131 
   132 /**
   133  * Do not edit below this line!
   134  */
   135 public Extension:__ext_tf2 = 
   136 {
   137 	name = "TF2 Tools",
   138 	file = "game.tf2.ext",
   139 	autoload = 1,
   140 #if defined REQUIRE_EXTENSIONS
   141 	required = 1,
   142 #else
   143 	required = 0,
   144 #endif
   145 };