plugins/include/tf2.inc
author Scott Ehlert <ds@alliedmods.net>
Mon Nov 24 09:41:46 2008 -0600 (2008-11-24)
changeset 2424 d95d696a82e5
parent 2039 cdf621aae4a9
child 2673 87d4d9f3cbc3
permissions -rw-r--r--
Added /MP back to core and sdktools MSVC project files.
     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 /**
    62  * Respawns a client
    63  *
    64  * @param client		Player's index.
    65  * @noreturn
    66  * @error				Invalid client index, client not in game, or no mod support.
    67  */
    68 native TF2_RespawnPlayer(client);
    69 
    70 /**
    71  * Disguises a client to the given model and team. Only has an effect on spies.
    72  *
    73  * Note: This only starts the disguise process and a delay occurs before the spy is fully disguised
    74  *
    75  * @param client		Player's index.
    76  * @param team			Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
    77  * @param class			TFClassType class to disguise the player as
    78  * @noreturn
    79  * @error				Invalid client index, client not in game, or no mod support.
    80  */
    81 native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class);
    82 
    83 /**
    84  * Removes the current disguise from a client. Only has an effect on spies.
    85  *
    86  * @param client		Player's index.
    87  * @noreturn
    88  * @error				Invalid client index, client not in game, or no mod support.
    89  */
    90 native TF2_RemovePlayerDisguise(client);
    91 
    92 /**
    93  * Retrieves the entity index of the CPlayerResource entity
    94  *
    95  * @return				The current resource entity index.
    96  */
    97 native TF2_GetResourceEntity();
    98 
    99 /**
   100  * Finds the TFClassType for a given class name.
   101  *
   102  * @param classname		A classname string such as "sniper" or "demoman"
   103  * @return				A TFClassType constant.
   104  */
   105 native TFClassType:TF2_GetClass(const String:classname[]);
   106 
   107 /**
   108  * Called on weapon fire to decide if the current shot should be critical.
   109  * Return Plugin_Continue to let the original calculation or return a higher
   110  * action to override the decision with the value of 'result'
   111  *
   112  * @note Since critical shots are also calculated client side any changes made with
   113  *		 this will not show for the shooter. Projectile weapons such as the rocketlauncher
   114  *		 and demoman weapons will show a critical bullet but no critical sound effect.
   115  *		 Bullet hits should appear as expected.
   116  *
   117  * @param client		Client Index.
   118  * @param weapon		Weapon entity Index.
   119  * @param weaponname	Classname of the weapon.
   120  * @param result		Buffer param for the result of the decision.
   121  */
   122 forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result);
   123 
   124 /**
   125  * Do not edit below this line!
   126  */
   127 public Extension:__ext_tf2 = 
   128 {
   129 	name = "TF2 Tools",
   130 	file = "game.tf2.ext",
   131 	autoload = 1,
   132 #if defined REQUIRE_EXTENSIONS
   133 	required = 1,
   134 #else
   135 	required = 0,
   136 #endif
   137 };