pred@1964: /**
pred@1964: * vim: set ts=4 :
pred@1964: * =============================================================================
pred@1964: * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
pred@1964: * =============================================================================
pred@1964: *
pred@1964: * This file is part of the SourceMod/SourcePawn SDK.
pred@1964: *
pred@1964: * This program is free software; you can redistribute it and/or modify it under
pred@1964: * the terms of the GNU General Public License, version 3.0, as published by the
pred@1964: * Free Software Foundation.
pred@1964: *
pred@1964: * This program is distributed in the hope that it will be useful, but WITHOUT
pred@1964: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
pred@1964: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
pred@1964: * details.
pred@1964: *
pred@1964: * You should have received a copy of the GNU General Public License along with
pred@1964: * this program. If not, see .
pred@1964: *
pred@1964: * As a special exception, AlliedModders LLC gives you permission to link the
pred@1964: * code of this program (as well as its derivative works) to "Half-Life 2," the
pred@1964: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
pred@1964: * by the Valve Corporation. You must obey the GNU General Public License in
pred@1964: * all respects for all other code used. Additionally, AlliedModders LLC grants
pred@1964: * this exception to all derivative works. AlliedModders LLC defines further
pred@1964: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
pred@1964: * or .
pred@1964: *
ds@1987: * Version: $Id$
pred@1964: */
pred@1964:
pred@1963: #if defined _tf2_included
pred@1963: #endinput
pred@1963: #endif
pred@1963: #define _tf2_included
pred@1963:
pred@1963: enum TFClassType
pred@1963: {
pred@1963: TFClass_Unknown = 0,
pred@1963: TFClass_Scout,
pred@1963: TFClass_Sniper,
pred@1963: TFClass_Soldier,
pred@1963: TFClass_DemoMan,
pred@1963: TFClass_Medic,
pred@1963: TFClass_Heavy,
pred@1963: TFClass_Pyro,
pred@1963: TFClass_Spy,
pred@1963: TFClass_Engineer
pred@2018: };
pred@1963:
pred@1963: enum TFTeam
pred@1963: {
pred@1963: TFTeam_Unassigned = 0,
pred@1963: TFTeam_Spectator = 1,
pred@1963: TFTeam_Red = 2,
pred@1963: TFTeam_Blue = 3
pred@2018: };
pred@1963:
pred@1963:
pred@1963: /**
pred@1963: * Respawns a client
pred@1963: *
pred@1963: * @param client Player's index.
pred@1963: * @noreturn
pred@1963: * @error Invalid client index, client not in game, or no mod support.
pred@1963: */
pred@1963: native TF2_RespawnPlayer(client);
pred@1963:
pred@1963: /**
pred@1963: * Disguises a client to the given model and team. Only has an effect on spies.
pred@1963: *
pred@1963: * Note: This only starts the disguise process and a delay occurs before the spy is fully disguised
pred@1963: *
pred@1963: * @param client Player's index.
pred@1963: * @param team Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
pred@1963: * @param class TFClassType class to disguise the player as
pred@1963: * @noreturn
pred@1963: * @error Invalid client index, client not in game, or no mod support.
pred@1963: */
pred@1963: native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class);
pred@1963:
pred@1963: /**
pred@1963: * Removes the current disguise from a client. Only has an effect on spies.
pred@1963: *
pred@1963: * @param client Player's index.
pred@1963: * @noreturn
pred@1963: * @error Invalid client index, client not in game, or no mod support.
pred@1963: */
pred@1963: native TF2_RemovePlayerDisguise(client);
pred@1963:
pred@1963: /**
pred@1963: * Retrieves the entity index of the CPlayerResource entity
pred@1963: *
pred@1963: * @return The current resource entity index.
pred@1963: */
pred@1963: native TF2_GetResourceEntity();
pred@1963:
pred@1963: /**
pred@1963: * Finds the TFClassType for a given class name.
pred@1963: *
pred@1963: * @param classname A classname string such as "sniper" or "demoman"
pred@1963: * @return A TFClassType constant.
pred@1963: */
pred@1963: native TFClassType:TF2_GetClass(const String:classname[]);
pred@1963:
pred@1963: /**
pred@1979: * Called on weapon fire to decide if the current shot should be critical.
pred@1979: * Return Plugin_Continue to let the original calculation or return a higher
pred@1979: * action to override the decision with the value of 'result'
pred@1979: *
pred@1979: * @note Since critical shots are also calculated client side any changes made with
pred@1979: * this will not show for the shooter. Projectile weapons such as the rocketlauncher
pred@1979: * and demoman weapons will show a critical bullet but no critical sound effect.
pred@1979: * Bullet hits should appear as expected.
pred@1979: *
pred@1979: * @param client Client Index.
pred@1979: * @param weapon Weapon entity Index.
pred@1979: * @param weaponname Classname of the weapon.
pred@1979: * @param result Buffer param for the result of the decision.
pred@1979: */
pred@1981: forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result);
pred@1979:
pred@1979: /**
pred@1963: * Do not edit below this line!
pred@1963: */
pred@1963: public Extension:__ext_tf2 =
pred@1963: {
pred@1963: name = "TF2 Tools",
pred@1963: file = "game.tf2.ext",
pred@1963: autoload = 1,
pred@1963: #if defined REQUIRE_EXTENSIONS
pred@1963: required = 1,
pred@1963: #else
pred@1963: required = 0,
pred@1963: #endif
pred@1963: };