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