3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
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
16 #if defined _sdktools_functions_included
19 #define _sdktools_functions_included
22 * Removes a player's item.
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
30 native bool:RemovePlayerItem(client, item);
33 * Gives a named item to a player.
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.
41 native GivePlayerItem(client, const String:item[], iSubType=0);
44 * Returns the weapon in a player's slot.
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.
51 native GetPlayerWeaponSlot(client, slot);
54 * Ignites an entity on fire.
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.
62 * @error Invalid entity or client not in game, or lack of mod support.
64 native IgniteEntity(entity, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
67 * Extinguishes a player that is on fire.
69 * @param entity Entity index.
71 * @error Invalid entity or client not in game, or lack of mod support.
73 native ExtinguishEntity(client);
76 * Teleports an entity.
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.
83 * @error Invalid entity or client not in game, or lack of mod support.
85 native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
88 * Forces a player to commit suicide.
90 * @param client Client index.
92 * @error Invalid client or client not in game, or lack of mod support.
94 native ForcePlayerSuicide(client);
97 * Slaps a player in a random direction.
99 * @param client Client index.
100 * @param health Health to subtract.
101 * @param sound False to disable the sound effects.
103 * @error Invalid client or client not in game, or lack of mod support.
105 native SlapPlayer(client, health=5, bool:sound=true);
108 * Searches for an entity by classname.
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.
116 native FindEntityByClassname(startEnt, const String:classname[]);
119 * Returns the client's eye angles.
121 * @param client Player's index.
122 * @param ang Destination vector to store the client's eye angles.
124 * @error Invalid client index, client not in game, or no mod support.
126 native GetClientEyeAngles(client, Float:ang[3]);
129 * Returns if the client is alive or dead.
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.
135 native bool:IsPlayerAlive(client);
140 #pragma deprecated Use IgniteEntity() instead
141 stock IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false)
143 return IgniteEntity(client, time, npc, size, level);
149 #pragma deprecated Use ExtinguishEntity() instead
150 stock ExtinguishClient(client)
152 return ExtinguishEntity(client);
158 #pragma deprecated Use TeleportEntity() instead
159 stock TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3])
161 return TeleportEntity(client, origin, angles, velocity);