1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/plugins/include/tf2.inc Sun Jul 06 04:49:55 2008 +0000
1.3 @@ -0,0 +1,137 @@
1.4 +/**
1.5 + * vim: set ts=4 :
1.6 + * =============================================================================
1.7 + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
1.8 + * =============================================================================
1.9 + *
1.10 + * This file is part of the SourceMod/SourcePawn SDK.
1.11 + *
1.12 + * This program is free software; you can redistribute it and/or modify it under
1.13 + * the terms of the GNU General Public License, version 3.0, as published by the
1.14 + * Free Software Foundation.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful, but WITHOUT
1.17 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.18 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.19 + * details.
1.20 + *
1.21 + * You should have received a copy of the GNU General Public License along with
1.22 + * this program. If not, see <http://www.gnu.org/licenses/>.
1.23 + *
1.24 + * As a special exception, AlliedModders LLC gives you permission to link the
1.25 + * code of this program (as well as its derivative works) to "Half-Life 2," the
1.26 + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
1.27 + * by the Valve Corporation. You must obey the GNU General Public License in
1.28 + * all respects for all other code used. Additionally, AlliedModders LLC grants
1.29 + * this exception to all derivative works. AlliedModders LLC defines further
1.30 + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
1.31 + * or <http://www.sourcemod.net/license.php>.
1.32 + *
1.33 + * Version: $Id$
1.34 + */
1.35 +
1.36 +#if defined _tf2_included
1.37 + #endinput
1.38 +#endif
1.39 +#define _tf2_included
1.40 +
1.41 +enum TFClassType
1.42 +{
1.43 + TFClass_Unknown = 0,
1.44 + TFClass_Scout,
1.45 + TFClass_Sniper,
1.46 + TFClass_Soldier,
1.47 + TFClass_DemoMan,
1.48 + TFClass_Medic,
1.49 + TFClass_Heavy,
1.50 + TFClass_Pyro,
1.51 + TFClass_Spy,
1.52 + TFClass_Engineer
1.53 +};
1.54 +
1.55 +enum TFTeam
1.56 +{
1.57 + TFTeam_Unassigned = 0,
1.58 + TFTeam_Spectator = 1,
1.59 + TFTeam_Red = 2,
1.60 + TFTeam_Blue = 3
1.61 +};
1.62 +
1.63 +
1.64 +/**
1.65 + * Respawns a client
1.66 + *
1.67 + * @param client Player's index.
1.68 + * @noreturn
1.69 + * @error Invalid client index, client not in game, or no mod support.
1.70 + */
1.71 +native TF2_RespawnPlayer(client);
1.72 +
1.73 +/**
1.74 + * Disguises a client to the given model and team. Only has an effect on spies.
1.75 + *
1.76 + * Note: This only starts the disguise process and a delay occurs before the spy is fully disguised
1.77 + *
1.78 + * @param client Player's index.
1.79 + * @param team Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
1.80 + * @param class TFClassType class to disguise the player as
1.81 + * @noreturn
1.82 + * @error Invalid client index, client not in game, or no mod support.
1.83 + */
1.84 +native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class);
1.85 +
1.86 +/**
1.87 + * Removes the current disguise from a client. Only has an effect on spies.
1.88 + *
1.89 + * @param client Player's index.
1.90 + * @noreturn
1.91 + * @error Invalid client index, client not in game, or no mod support.
1.92 + */
1.93 +native TF2_RemovePlayerDisguise(client);
1.94 +
1.95 +/**
1.96 + * Retrieves the entity index of the CPlayerResource entity
1.97 + *
1.98 + * @return The current resource entity index.
1.99 + */
1.100 +native TF2_GetResourceEntity();
1.101 +
1.102 +/**
1.103 + * Finds the TFClassType for a given class name.
1.104 + *
1.105 + * @param classname A classname string such as "sniper" or "demoman"
1.106 + * @return A TFClassType constant.
1.107 + */
1.108 +native TFClassType:TF2_GetClass(const String:classname[]);
1.109 +
1.110 +/**
1.111 + * Called on weapon fire to decide if the current shot should be critical.
1.112 + * Return Plugin_Continue to let the original calculation or return a higher
1.113 + * action to override the decision with the value of 'result'
1.114 + *
1.115 + * @note Since critical shots are also calculated client side any changes made with
1.116 + * this will not show for the shooter. Projectile weapons such as the rocketlauncher
1.117 + * and demoman weapons will show a critical bullet but no critical sound effect.
1.118 + * Bullet hits should appear as expected.
1.119 + *
1.120 + * @param client Client Index.
1.121 + * @param weapon Weapon entity Index.
1.122 + * @param weaponname Classname of the weapon.
1.123 + * @param result Buffer param for the result of the decision.
1.124 + */
1.125 +forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result);
1.126 +
1.127 +/**
1.128 + * Do not edit below this line!
1.129 + */
1.130 +public Extension:__ext_tf2 =
1.131 +{
1.132 + name = "TF2 Tools",
1.133 + file = "game.tf2.ext",
1.134 + autoload = 1,
1.135 +#if defined REQUIRE_EXTENSIONS
1.136 + required = 1,
1.137 +#else
1.138 + required = 0,
1.139 +#endif
1.140 +};