plugins/include/sdktools_functions.inc
author Phong Dang <teame06@gmail.com>
Wed Aug 01 04:17:36 2007 +0000 (2007-08-01)
changeset 1235 88bb46f9731e
parent 1219 6f440a361fa7
child 1239 eed86aca8fae
permissions -rw-r--r--
Implemented requested amb603. Added voice natives.
     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  * Returns the client's eye angles.
   109  *
   110  * @param client		Player's index.
   111  * @param ang			Destination vector to store the client's eye angles.
   112  * @noreturn
   113  * @error				Invalid client index, client not in game, or no mod support.
   114  */
   115 native GetClientEyeAngles(client, Float:ang[3]);
   116 
   117 /**
   118  * @deprecated
   119  */
   120 stock IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false)
   121 {
   122 	return IgniteEntity(client, time, npc, size, level);
   123 }
   124 
   125 /**
   126  * @deprecated
   127  */
   128 stock ExtinguishClient(client)
   129 {
   130 	return ExtinguishEntity(client);
   131 }
   132 
   133 /**
   134  * @deprecated
   135  */
   136 stock TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3])
   137 {
   138 	return TeleportEntity(client, origin, angles, velocity);
   139 }