1.1 --- a/plugins/include/sdktools_functions.inc Fri Mar 28 06:21:34 2008 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,282 +0,0 @@
1.4 -/**
1.5 - * vim: set ts=4 :
1.6 - * =============================================================================
1.7 - * SourceMod (C)2004-2007 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 _sdktools_functions_included
1.37 - #endinput
1.38 -#endif
1.39 -#define _sdktools_functions_included
1.40 -
1.41 -/**
1.42 - * Removes a player's item.
1.43 - *
1.44 - * @param client Client index.
1.45 - * @param item CBaseCombatWeapon entity index.
1.46 - * @return True on success, false otherwise.
1.47 - * @error Invalid client or entity, lack of mod support, or client not in
1.48 - * game.
1.49 - */
1.50 -native bool:RemovePlayerItem(client, item);
1.51 -
1.52 -/**
1.53 - * Gives a named item to a player.
1.54 - *
1.55 - * @param client Client index.
1.56 - * @param item Item classname (such as weapon_ak47).
1.57 - * @param iSubType Unknown.
1.58 - * @return Entity index on success, or -1 on failure.
1.59 - * @error Invalid client or client not in game, or lack of mod support.
1.60 - */
1.61 -native GivePlayerItem(client, const String:item[], iSubType=0);
1.62 -
1.63 -/**
1.64 - * Returns the weapon in a player's slot.
1.65 - *
1.66 - * @param client Client index.
1.67 - * @param slot Slot index (mod specific).
1.68 - * @return Entity index on success, -1 if no weapon existed.
1.69 - * @error Invalid client or client not in game, or lack of mod support.
1.70 - */
1.71 -native GetPlayerWeaponSlot(client, slot);
1.72 -
1.73 -/**
1.74 - * Ignites an entity on fire.
1.75 - *
1.76 - * @param entity Entity index.
1.77 - * @param time Number of seconds to set on fire.
1.78 - * @param npc True to only affect NPCs.
1.79 - * @param size Unknown.
1.80 - * @param level Unknown.
1.81 - * @noreturn
1.82 - * @error Invalid entity or client not in game, or lack of mod support.
1.83 - */
1.84 -native IgniteEntity(entity, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
1.85 -
1.86 -/**
1.87 - * Extinguishes a player that is on fire.
1.88 - *
1.89 - * @param entity Entity index.
1.90 - * @noreturn
1.91 - * @error Invalid entity or client not in game, or lack of mod support.
1.92 - */
1.93 -native ExtinguishEntity(client);
1.94 -
1.95 -/**
1.96 - * Teleports an entity.
1.97 - *
1.98 - * @param entity Client index.
1.99 - * @param origin New origin, or NULL_VECTOR for no change.
1.100 - * @param angles New angles, or NULL_VECTOR for no change.
1.101 - * @param velocity New velocity, or NULL_VECTOR for no change.
1.102 - * @noreturn
1.103 - * @error Invalid entity or client not in game, or lack of mod support.
1.104 - */
1.105 -native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
1.106 -
1.107 -/**
1.108 - * Forces a player to commit suicide.
1.109 - *
1.110 - * @param client Client index.
1.111 - * @noreturn
1.112 - * @error Invalid client or client not in game, or lack of mod support.
1.113 - */
1.114 -native ForcePlayerSuicide(client);
1.115 -
1.116 -/**
1.117 - * Slaps a player in a random direction.
1.118 - *
1.119 - * @param client Client index.
1.120 - * @param health Health to subtract.
1.121 - * @param sound False to disable the sound effects.
1.122 - * @noreturn
1.123 - * @error Invalid client or client not in game, or lack of mod support.
1.124 - */
1.125 -native SlapPlayer(client, health=5, bool:sound=true);
1.126 -
1.127 -/**
1.128 - * Searches for an entity by classname.
1.129 - *
1.130 - * @param startEnt The entity index to begin searching from.
1.131 - * Use -1 to start from the first entity.
1.132 - * @param classname Classname of the entity to find.
1.133 - * @return Entity index >= 0 if found, -1 otherwise.
1.134 - * @error Lack of mod support.
1.135 - */
1.136 -native FindEntityByClassname(startEnt, const String:classname[]);
1.137 -
1.138 -/**
1.139 - * Returns the client's eye angles.
1.140 - *
1.141 - * @param client Player's index.
1.142 - * @param ang Destination vector to store the client's eye angles.
1.143 - * @return True on success, false on failure.
1.144 - * @error Invalid client index, client not in game, or no mod support.
1.145 - */
1.146 -native bool:GetClientEyeAngles(client, Float:ang[3]);
1.147 -
1.148 -/**
1.149 - * Creates an entity by string name, but does not spawn it (see DispatchSpawn).
1.150 - * If ForceEdictIndex is not -1, then it will use the edict by that index. If the index is
1.151 - * invalid or there is already an edict using that index, it will error out.
1.152 - *
1.153 - * @param classname Entity classname.
1.154 - * @param ForceEdictIndex Edict index used by the created entity.
1.155 - * @return Entity index on success, or -1 on failure.
1.156 - * @error Invalid edict index, or no mod support.
1.157 - */
1.158 -native CreateEntityByName(const String:classname[], ForceEdictIndex=-1);
1.159 -
1.160 -/**
1.161 - * Spawns an entity into the game.
1.162 - *
1.163 - * @param entity Entity index of the created entity.
1.164 - * @return True on success, false otherwise.
1.165 - * @error Invalid entity index, or no mod support.
1.166 - */
1.167 -native bool:DispatchSpawn(entity);
1.168 -
1.169 -/**
1.170 - * Dispatches a KeyValue into given entity using a string value.
1.171 - *
1.172 - * @param entity Destination entity index.
1.173 - * @param keyName Name of the key.
1.174 - * @param value String value.
1.175 - * @return True on success, false otherwise.
1.176 - * @error Invalid entity index, or no mod support.
1.177 - */
1.178 -native bool:DispatchKeyValue(entity, const String:keyName[], const String:value[]);
1.179 -
1.180 -/**
1.181 - * Dispatches a KeyValue into given entity using a floating point value.
1.182 - *
1.183 - * @param entity Destination entity index.
1.184 - * @param keyName Name of the key.
1.185 - * @param value Floating point value.
1.186 - * @return True on success, false otherwise.
1.187 - * @error Invalid entity index, or no mod support.
1.188 - */
1.189 -native bool:DispatchKeyValueFloat(entity, const String:keyName[], Float:value);
1.190 -
1.191 -/**
1.192 - * Dispatches a KeyValue into given entity using a vector value.
1.193 - *
1.194 - * @param entity Destination entity index.
1.195 - * @param keyName Name of the key.
1.196 - * @param vec Vector value.
1.197 - * @return True on success, false otherwise.
1.198 - * @error Invalid entity index, or no mod support.
1.199 - */
1.200 -native bool:DispatchKeyValueVector(entity, const String:keyName[], const Float:vector[3]);
1.201 -
1.202 -/**
1.203 - * Returns the entity a client is aiming at.
1.204 - *
1.205 - * @param client Client performing the aiming.
1.206 - * @param only_clients True to exclude all entities but clients.
1.207 - * @return Entity index being aimed at.
1.208 - * -1 if no entity is being aimed at.
1.209 - * -2 if the function is not supported.
1.210 - * @error Invalid client index or client not in game.
1.211 - */
1.212 -native GetClientAimTarget(client, bool:only_clients=true);
1.213 -
1.214 -/**
1.215 - * Returns the total number of teams in a game.
1.216 - *
1.217 - * @return Total number of teams.
1.218 - */
1.219 -native GetTeamCount();
1.220 -
1.221 -/**
1.222 - * Retrieves the team name based on a team index.
1.223 - *
1.224 - * @param index Team index.
1.225 - * @param name Buffer to store string in.
1.226 - * @param maxlength Maximum length of string buffer.
1.227 - * @noreturn
1.228 - * @error Invalid team index.
1.229 - */
1.230 -native GetTeamName(index, String:name[], maxlength);
1.231 -
1.232 -/**
1.233 - * Returns the score of a team based on a team index.
1.234 - *
1.235 - * @param index Team index.
1.236 - * @return Score.
1.237 - * @error Invalid team index.
1.238 - */
1.239 -native GetTeamScore(index);
1.240 -
1.241 -/**
1.242 - * Sets the score of a team based on a team index.
1.243 - *
1.244 - * @param index Team index.
1.245 - * @param value New score value.
1.246 - * @return Score.
1.247 - * @error Invalid team index.
1.248 - */
1.249 -native SetTeamScore(index, value);
1.250 -
1.251 -/**
1.252 - * Retrieves the number of players in a certain team.
1.253 - *
1.254 - * @param index Team index.
1.255 - * @return Number of players in the team.
1.256 - * @error Invalid team index.
1.257 - */
1.258 -native GetTeamClientCount(index);
1.259 -
1.260 -/**
1.261 - * @deprecated
1.262 - */
1.263 -#pragma deprecated Use IgniteEntity() instead
1.264 -stock IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false)
1.265 -{
1.266 - return IgniteEntity(client, time, npc, size, level);
1.267 -}
1.268 -
1.269 -/**
1.270 - * @deprecated
1.271 - */
1.272 -#pragma deprecated Use ExtinguishEntity() instead
1.273 -stock ExtinguishClient(client)
1.274 -{
1.275 - return ExtinguishEntity(client);
1.276 -}
1.277 -
1.278 -/**
1.279 - * @deprecated
1.280 - */
1.281 -#pragma deprecated Use TeleportEntity() instead
1.282 -stock TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3])
1.283 -{
1.284 - return TeleportEntity(client, origin, angles, velocity);
1.285 -}