plugins/include/sdktools_functions.inc
author David Anderson <dvander@alliedmods.net>
Tue Aug 14 01:00:42 2007 +0000 (2007-08-14)
changeset 1324 9d1983bf06c7
parent 1268 9360f5ea2289
child 1330 ab94316bb52b
permissions -rw-r--r--
added SQL_CheckConfig() so sql admin plugins can default back
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     7  *  This file is part of the SourceMod/SourcePawn SDK.  This file may only be used 
     8  * or modified under the Terms and Conditions of its License Agreement, which is found 
     9  * in LICENSE.txt.  The Terms and Conditions for making SourceMod extensions/plugins 
    10  * may change at any time.  To view the latest information, see:
    11  *   http://www.sourcemod.net/license.php
    12  *
    13  * Version: $Id$ 
    14  */
    15 
    16 #if defined _sdktools_functions_included
    17   #endinput
    18 #endif
    19 #define _sdktools_functions_included
    20 
    21 /**
    22  * Removes a player's item.
    23  *
    24  * @param client		Client index.
    25  * @param item			CBaseCombatWeapon entity index.
    26  * @return				True on success, false otherwise.
    27  * @error				Invalid client or entity, lack of mod support, or client not in 
    28  *						game.
    29  */
    30 native bool:RemovePlayerItem(client, item);
    31 
    32 /**
    33  * Gives a named item to a player.
    34  *
    35  * @param client		Client index.
    36  * @param item			Item classname (such as weapon_ak47).
    37  * @param iSubType		Unknown.
    38  * @return				Entity index on success, or -1 on failure.
    39  * @error				Invalid client or client not in game, or lack of mod support.
    40  */
    41 native GivePlayerItem(client, const String:item[], iSubType=0);
    42 
    43 /**
    44  * Returns the weapon in a player's slot.  
    45  *
    46  * @param client		Client index.
    47  * @param slot			Slot index (mod specific).
    48  * @return				Entity index on success, -1 if no weapon existed.
    49  * @error				Invalid client or client not in game, or lack of mod support.
    50  */
    51 native GetPlayerWeaponSlot(client, slot);
    52 
    53 /**
    54  * Ignites an entity on fire.
    55  *
    56  * @param entity		Entity index.
    57  * @param time			Number of seconds to set on fire.
    58  * @param npc			True to only affect NPCs.
    59  * @param size			Unknown.
    60  * @param level			Unknown.
    61  * @noreturn
    62  * @error				Invalid entity or client not in game, or lack of mod support.
    63  */
    64 native IgniteEntity(entity, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
    65 
    66 /**
    67  * Extinguishes a player that is on fire.
    68  *
    69  * @param entity		Entity index.
    70  * @noreturn
    71  * @error				Invalid entity or client not in game, or lack of mod support.
    72  */
    73 native ExtinguishEntity(client);
    74 
    75 /**
    76  * Teleports an entity.
    77  *
    78  * @param entity		Client index.
    79  * @param origin		New origin, or NULL_VECTOR for no change.
    80  * @param angles		New angles, or NULL_VECTOR for no change.
    81  * @param velocity		New velocity, or NULL_VECTOR for no change.
    82  * @noreturn
    83  * @error				Invalid entity or client not in game, or lack of mod support.
    84  */
    85 native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
    86 
    87 /**
    88  * Forces a player to commit suicide.
    89  *
    90  * @param client		Client index.
    91  * @noreturn
    92  * @error				Invalid client or client not in game, or lack of mod support.
    93  */
    94 native ForcePlayerSuicide(client);
    95 
    96 /**
    97  * Slaps a player in a random direction.
    98  *
    99  * @param client		Client index.
   100  * @param health		Health to subtract.
   101  * @param sound			False to disable the sound effects.
   102  * @noreturn
   103  * @error				Invalid client or client not in game, or lack of mod support.
   104  */
   105 native SlapPlayer(client, health=5, bool:sound=true);
   106 
   107 /**
   108  * Searches for an entity by classname.
   109  *
   110  * @param startEnt		The entity index to begin searching from.
   111  *						Use -1 to start from the first entity.
   112  * @param classname		Classname of the entity to find.
   113  * @return				Entity index >= 0 if found, -1 otherwise.
   114  * @error				Lack of mod support.
   115  */
   116 native FindEntityByClassname(startEnt, const String:classname[]);
   117 
   118 /**
   119  * Returns the client's eye angles.
   120  *
   121  * @param client		Player's index.
   122  * @param ang			Destination vector to store the client's eye angles.
   123  * @noreturn
   124  * @error				Invalid client index, client not in game, or no mod support.
   125  */
   126 native GetClientEyeAngles(client, Float:ang[3]);
   127 
   128 /**
   129  * Returns if the client is alive or dead.
   130  *
   131  * @param client		Player's index.
   132  * @return			True if the client is alive, false otherwise.
   133  * @error				Invalid client index, client not in game, or no mod support.
   134  */
   135 native bool:IsPlayerAlive(client);
   136 
   137 /**
   138  * @deprecated
   139  */
   140 #pragma deprecated Use IgniteEntity() instead
   141 stock IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false)
   142 {
   143 	return IgniteEntity(client, time, npc, size, level);
   144 }
   145 
   146 /**
   147  * @deprecated
   148  */
   149 #pragma deprecated Use ExtinguishEntity() instead
   150 stock ExtinguishClient(client)
   151 {
   152 	return ExtinguishEntity(client);
   153 }
   154 
   155 /**
   156  * @deprecated
   157  */
   158 #pragma deprecated Use TeleportEntity() instead
   159 stock TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3])
   160 {
   161 	return TeleportEntity(client, origin, angles, velocity);
   162 }