plugins/include/tf2.inc
author David Anderson <dvander@alliedmods.net>
Sun Sep 14 18:25:44 2008 -0500 (2008-09-14)
changeset 2294 9a9f3ed9745d
parent 2039 cdf621aae4a9
child 2673 87d4d9f3cbc3
permissions -rw-r--r--
Triggering build.
pred@1964
     1
/**
pred@1964
     2
 * vim: set ts=4 :
pred@1964
     3
 * =============================================================================
pred@1964
     4
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
pred@1964
     5
 * =============================================================================
pred@1964
     6
 *
pred@1964
     7
 * This file is part of the SourceMod/SourcePawn SDK.
pred@1964
     8
 *
pred@1964
     9
 * This program is free software; you can redistribute it and/or modify it under
pred@1964
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
pred@1964
    11
 * Free Software Foundation.
pred@1964
    12
 * 
pred@1964
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
pred@1964
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
pred@1964
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
pred@1964
    16
 * details.
pred@1964
    17
 *
pred@1964
    18
 * You should have received a copy of the GNU General Public License along with
pred@1964
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
pred@1964
    20
 *
pred@1964
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
pred@1964
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
pred@1964
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
pred@1964
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
pred@1964
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
pred@1964
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
pred@1964
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
pred@1964
    28
 * or <http://www.sourcemod.net/license.php>.
pred@1964
    29
 *
ds@1987
    30
 * Version: $Id$
pred@1964
    31
 */
pred@1964
    32
pred@1963
    33
#if defined _tf2_included
pred@1963
    34
 #endinput
pred@1963
    35
#endif
pred@1963
    36
#define _tf2_included
pred@1963
    37
pred@1963
    38
enum TFClassType
pred@1963
    39
{
pred@1963
    40
	TFClass_Unknown = 0,
pred@1963
    41
	TFClass_Scout,
pred@1963
    42
	TFClass_Sniper,
pred@1963
    43
	TFClass_Soldier,
pred@1963
    44
	TFClass_DemoMan,
pred@1963
    45
	TFClass_Medic,
pred@1963
    46
	TFClass_Heavy,
pred@1963
    47
	TFClass_Pyro,
pred@1963
    48
	TFClass_Spy,
pred@1963
    49
	TFClass_Engineer
pred@2018
    50
};
pred@1963
    51
pred@1963
    52
enum TFTeam
pred@1963
    53
{
pred@1963
    54
	TFTeam_Unassigned = 0,
pred@1963
    55
	TFTeam_Spectator = 1,
pred@1963
    56
	TFTeam_Red = 2,
pred@1963
    57
	TFTeam_Blue = 3	
pred@2018
    58
};
pred@1963
    59
pred@1963
    60
pred@1963
    61
/**
pred@1963
    62
 * Respawns a client
pred@1963
    63
 *
pred@1963
    64
 * @param client		Player's index.
pred@1963
    65
 * @noreturn
pred@1963
    66
 * @error				Invalid client index, client not in game, or no mod support.
pred@1963
    67
 */
pred@1963
    68
native TF2_RespawnPlayer(client);
pred@1963
    69
pred@1963
    70
/**
pred@1963
    71
 * Disguises a client to the given model and team. Only has an effect on spies.
pred@1963
    72
 *
pred@1963
    73
 * Note: This only starts the disguise process and a delay occurs before the spy is fully disguised
pred@1963
    74
 *
pred@1963
    75
 * @param client		Player's index.
pred@1963
    76
 * @param team			Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
pred@1963
    77
 * @param class			TFClassType class to disguise the player as
pred@1963
    78
 * @noreturn
pred@1963
    79
 * @error				Invalid client index, client not in game, or no mod support.
pred@1963
    80
 */
pred@1963
    81
native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class);
pred@1963
    82
pred@1963
    83
/**
pred@1963
    84
 * Removes the current disguise from a client. Only has an effect on spies.
pred@1963
    85
 *
pred@1963
    86
 * @param client		Player's index.
pred@1963
    87
 * @noreturn
pred@1963
    88
 * @error				Invalid client index, client not in game, or no mod support.
pred@1963
    89
 */
pred@1963
    90
native TF2_RemovePlayerDisguise(client);
pred@1963
    91
pred@1963
    92
/**
pred@1963
    93
 * Retrieves the entity index of the CPlayerResource entity
pred@1963
    94
 *
pred@1963
    95
 * @return				The current resource entity index.
pred@1963
    96
 */
pred@1963
    97
native TF2_GetResourceEntity();
pred@1963
    98
pred@1963
    99
/**
pred@1963
   100
 * Finds the TFClassType for a given class name.
pred@1963
   101
 *
pred@1963
   102
 * @param classname		A classname string such as "sniper" or "demoman"
pred@1963
   103
 * @return				A TFClassType constant.
pred@1963
   104
 */
pred@1963
   105
native TFClassType:TF2_GetClass(const String:classname[]);
pred@1963
   106
pred@1963
   107
/**
pred@1979
   108
 * Called on weapon fire to decide if the current shot should be critical.
pred@1979
   109
 * Return Plugin_Continue to let the original calculation or return a higher
pred@1979
   110
 * action to override the decision with the value of 'result'
pred@1979
   111
 *
pred@1979
   112
 * @note Since critical shots are also calculated client side any changes made with
pred@1979
   113
 *		 this will not show for the shooter. Projectile weapons such as the rocketlauncher
pred@1979
   114
 *		 and demoman weapons will show a critical bullet but no critical sound effect.
pred@1979
   115
 *		 Bullet hits should appear as expected.
pred@1979
   116
 *
pred@1979
   117
 * @param client		Client Index.
pred@1979
   118
 * @param weapon		Weapon entity Index.
pred@1979
   119
 * @param weaponname	Classname of the weapon.
pred@1979
   120
 * @param result		Buffer param for the result of the decision.
pred@1979
   121
 */
pred@1981
   122
forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result);
pred@1979
   123
pred@1979
   124
/**
pred@1963
   125
 * Do not edit below this line!
pred@1963
   126
 */
pred@1963
   127
public Extension:__ext_tf2 = 
pred@1963
   128
{
pred@1963
   129
	name = "TF2 Tools",
pred@1963
   130
	file = "game.tf2.ext",
pred@1963
   131
	autoload = 1,
pred@1963
   132
#if defined REQUIRE_EXTENSIONS
pred@1963
   133
	required = 1,
pred@1963
   134
#else
pred@1963
   135
	required = 0,
pred@1963
   136
#endif
pred@1963
   137
};