|
dvander@954
|
1 |
/** |
|
dvander@954
|
2 |
* vim: set ts=4 : |
|
ds@1330
|
3 |
* ============================================================================= |
|
dvander@954
|
4 |
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. |
|
ds@1330
|
5 |
* ============================================================================= |
|
ds@1330
|
6 |
* |
|
ds@1330
|
7 |
* This file is part of the SourceMod/SourcePawn SDK. |
|
dvander@954
|
8 |
* |
|
ds@1330
|
9 |
* This program is free software; you can redistribute it and/or modify it under |
|
ds@1330
|
10 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
ds@1330
|
11 |
* Free Software Foundation. |
|
ds@1330
|
12 |
* |
|
ds@1330
|
13 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
ds@1330
|
14 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
ds@1330
|
15 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
ds@1330
|
16 |
* details. |
|
dvander@954
|
17 |
* |
|
ds@1330
|
18 |
* You should have received a copy of the GNU General Public License along with |
|
ds@1330
|
19 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
ds@1330
|
20 |
* |
|
ds@1330
|
21 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
ds@1330
|
22 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
ds@1330
|
23 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
ds@1330
|
24 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
ds@1330
|
25 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
ds@1330
|
26 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
ds@1330
|
27 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
ds@1330
|
28 |
* or <http://www.sourcemod.net/license.php>. |
|
ds@1330
|
29 |
* |
|
ds@1330
|
30 |
* Version: $Id$ |
|
dvander@954
|
31 |
*/ |
|
dvander@954
|
32 |
|
|
dvander@954
|
33 |
#if defined _sdktools_functions_included |
|
dvander@954
|
34 |
#endinput |
|
dvander@954
|
35 |
#endif |
|
dvander@954
|
36 |
#define _sdktools_functions_included |
|
dvander@954
|
37 |
|
|
dvander@954
|
38 |
/** |
|
dvander@954
|
39 |
* Removes a player's item. |
|
dvander@954
|
40 |
* |
|
dvander@954
|
41 |
* @param client Client index. |
|
dvander@954
|
42 |
* @param item CBaseCombatWeapon entity index. |
|
dvander@954
|
43 |
* @return True on success, false otherwise. |
|
dvander@954
|
44 |
* @error Invalid client or entity, lack of mod support, or client not in |
|
dvander@954
|
45 |
* game. |
|
dvander@954
|
46 |
*/ |
|
dvander@954
|
47 |
native bool:RemovePlayerItem(client, item); |
|
dvander@954
|
48 |
|
|
dvander@954
|
49 |
/** |
|
dvander@954
|
50 |
* Gives a named item to a player. |
|
dvander@954
|
51 |
* |
|
dvander@954
|
52 |
* @param client Client index. |
|
dvander@954
|
53 |
* @param item Item classname (such as weapon_ak47). |
|
dvander@954
|
54 |
* @param iSubType Unknown. |
|
dvander@954
|
55 |
* @return Entity index on success, or -1 on failure. |
|
dvander@954
|
56 |
* @error Invalid client or client not in game, or lack of mod support. |
|
dvander@954
|
57 |
*/ |
|
dvander@954
|
58 |
native GivePlayerItem(client, const String:item[], iSubType=0); |
|
dvander@954
|
59 |
|
|
dvander@954
|
60 |
/** |
|
dvander@954
|
61 |
* Returns the weapon in a player's slot. |
|
dvander@954
|
62 |
* |
|
dvander@954
|
63 |
* @param client Client index. |
|
dvander@954
|
64 |
* @param slot Slot index (mod specific). |
|
dvander@954
|
65 |
* @return Entity index on success, -1 if no weapon existed. |
|
dvander@955
|
66 |
* @error Invalid client or client not in game, or lack of mod support. |
|
dvander@955
|
67 |
*/ |
|
dvander@955
|
68 |
native GetPlayerWeaponSlot(client, slot); |
|
dvander@955
|
69 |
|
|
dvander@955
|
70 |
/** |
|
dvander@980
|
71 |
* Ignites an entity on fire. |
|
dvander@955
|
72 |
* |
|
dvander@980
|
73 |
* @param entity Entity index. |
|
dvander@955
|
74 |
* @param time Number of seconds to set on fire. |
|
dvander@955
|
75 |
* @param npc True to only affect NPCs. |
|
dvander@955
|
76 |
* @param size Unknown. |
|
dvander@955
|
77 |
* @param level Unknown. |
|
dvander@955
|
78 |
* @noreturn |
|
dvander@980
|
79 |
* @error Invalid entity or client not in game, or lack of mod support. |
|
dvander@954
|
80 |
*/ |
|
dvander@980
|
81 |
native IgniteEntity(entity, Float:time, bool:npc=false, Float:size=0.0, bool:level=false); |
|
dvander@955
|
82 |
|
|
dvander@955
|
83 |
/** |
|
dvander@955
|
84 |
* Extinguishes a player that is on fire. |
|
dvander@955
|
85 |
* |
|
dvander@980
|
86 |
* @param entity Entity index. |
|
dvander@955
|
87 |
* @noreturn |
|
dvander@980
|
88 |
* @error Invalid entity or client not in game, or lack of mod support. |
|
dvander@955
|
89 |
*/ |
|
dvander@980
|
90 |
native ExtinguishEntity(client); |
|
dvander@955
|
91 |
|
|
dvander@955
|
92 |
/** |
|
dvander@980
|
93 |
* Teleports an entity. |
|
dvander@955
|
94 |
* |
|
dvander@980
|
95 |
* @param entity Client index. |
|
dvander@955
|
96 |
* @param origin New origin, or NULL_VECTOR for no change. |
|
dvander@955
|
97 |
* @param angles New angles, or NULL_VECTOR for no change. |
|
dvander@955
|
98 |
* @param velocity New velocity, or NULL_VECTOR for no change. |
|
dvander@955
|
99 |
* @noreturn |
|
dvander@980
|
100 |
* @error Invalid entity or client not in game, or lack of mod support. |
|
dvander@980
|
101 |
*/ |
|
dvander@980
|
102 |
native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]); |
|
dvander@980
|
103 |
|
|
dvander@980
|
104 |
/** |
|
dvander@1151
|
105 |
* Forces a player to commit suicide. |
|
dvander@1151
|
106 |
* |
|
dvander@1151
|
107 |
* @param client Client index. |
|
dvander@1151
|
108 |
* @noreturn |
|
dvander@1169
|
109 |
* @error Invalid client or client not in game, or lack of mod support. |
|
dvander@1151
|
110 |
*/ |
|
dvander@1151
|
111 |
native ForcePlayerSuicide(client); |
|
dvander@1151
|
112 |
|
|
dvander@1151
|
113 |
/** |
|
dvander@1169
|
114 |
* Slaps a player in a random direction. |
|
dvander@1169
|
115 |
* |
|
dvander@1169
|
116 |
* @param client Client index. |
|
dvander@1169
|
117 |
* @param health Health to subtract. |
|
dvander@1169
|
118 |
* @param sound False to disable the sound effects. |
|
dvander@1169
|
119 |
* @noreturn |
|
dvander@1169
|
120 |
* @error Invalid client or client not in game, or lack of mod support. |
|
dvander@1169
|
121 |
*/ |
|
dvander@1169
|
122 |
native SlapPlayer(client, health=5, bool:sound=true); |
|
dvander@1169
|
123 |
|
|
dvander@1169
|
124 |
/** |
|
ds@1240
|
125 |
* Searches for an entity by classname. |
|
ds@1240
|
126 |
* |
|
ds@1240
|
127 |
* @param startEnt The entity index to begin searching from. |
|
ds@1240
|
128 |
* Use -1 to start from the first entity. |
|
ds@1240
|
129 |
* @param classname Classname of the entity to find. |
|
ds@1240
|
130 |
* @return Entity index >= 0 if found, -1 otherwise. |
|
ds@1240
|
131 |
* @error Lack of mod support. |
|
ds@1240
|
132 |
*/ |
|
ds@1240
|
133 |
native FindEntityByClassname(startEnt, const String:classname[]); |
|
ds@1240
|
134 |
|
|
ds@1240
|
135 |
/** |
|
faluco@1219
|
136 |
* Returns the client's eye angles. |
|
faluco@1219
|
137 |
* |
|
faluco@1219
|
138 |
* @param client Player's index. |
|
faluco@1219
|
139 |
* @param ang Destination vector to store the client's eye angles. |
|
faluco@1219
|
140 |
* @noreturn |
|
faluco@1219
|
141 |
* @error Invalid client index, client not in game, or no mod support. |
|
faluco@1219
|
142 |
*/ |
|
faluco@1219
|
143 |
native GetClientEyeAngles(client, Float:ang[3]); |
|
faluco@1219
|
144 |
|
|
faluco@1219
|
145 |
/** |
|
teame06@1239
|
146 |
* Returns if the client is alive or dead. |
|
teame06@1239
|
147 |
* |
|
teame06@1239
|
148 |
* @param client Player's index. |
|
teame06@1244
|
149 |
* @return True if the client is alive, false otherwise. |
|
teame06@1239
|
150 |
* @error Invalid client index, client not in game, or no mod support. |
|
teame06@1239
|
151 |
*/ |
|
teame06@1239
|
152 |
native bool:IsPlayerAlive(client); |
|
teame06@1239
|
153 |
|
|
teame06@1239
|
154 |
/** |
|
faluco@1428
|
155 |
* Creates an entity by string name, but does not spawn it (see DispatchSpawn). |
|
faluco@1428
|
156 |
* If ForceEdictIndex is not -1, then it will use the edict by that index. If the index is |
|
faluco@1428
|
157 |
* invalid or there is already an edict using that index, it will error out. |
|
faluco@1428
|
158 |
* |
|
faluco@1428
|
159 |
* @param classname Entity classname. |
|
faluco@1428
|
160 |
* @param ForceEdictIndex Edict index used by the created entity. |
|
faluco@1428
|
161 |
* @return Entity index on success, or -1 on failure. |
|
faluco@1428
|
162 |
* @error Invalid edict index, or no mod support. |
|
faluco@1428
|
163 |
*/ |
|
faluco@1428
|
164 |
native CreateEntityByName(const String:classname[], ForceEdictIndex=-1); |
|
faluco@1428
|
165 |
|
|
faluco@1428
|
166 |
/** |
|
faluco@1428
|
167 |
* Spawns an entity into the game. |
|
faluco@1428
|
168 |
* |
|
faluco@1428
|
169 |
* @param entity Entity index of the created entity. |
|
faluco@1428
|
170 |
* @return True on success, false otherwise. |
|
faluco@1428
|
171 |
* @error Invalid entity index, or no mod support. |
|
faluco@1428
|
172 |
*/ |
|
faluco@1428
|
173 |
native bool:DispatchSpawn(entity); |
|
faluco@1428
|
174 |
|
|
faluco@1428
|
175 |
/** |
|
faluco@1504
|
176 |
* Dispatches a KeyValue into given entity using a string value. |
|
faluco@1504
|
177 |
* |
|
faluco@1504
|
178 |
* @param entity Destination entity index. |
|
faluco@1504
|
179 |
* @param keyName Name of the key. |
|
faluco@1504
|
180 |
* @param value String value. |
|
faluco@1504
|
181 |
* @return True on success, false otherwise. |
|
faluco@1504
|
182 |
* @error Invalid entity index, or no mod support. |
|
faluco@1504
|
183 |
*/ |
|
faluco@1504
|
184 |
native bool:DispatchKeyValue(entity, const String:keyName[], const String:value[]); |
|
faluco@1504
|
185 |
|
|
faluco@1504
|
186 |
/** |
|
faluco@1504
|
187 |
* Dispatches a KeyValue into given entity using a floating point value. |
|
faluco@1504
|
188 |
* |
|
faluco@1504
|
189 |
* @param entity Destination entity index. |
|
faluco@1504
|
190 |
* @param keyName Name of the key. |
|
faluco@1504
|
191 |
* @param value Floating point value. |
|
faluco@1504
|
192 |
* @return True on success, false otherwise. |
|
faluco@1504
|
193 |
* @error Invalid entity index, or no mod support. |
|
faluco@1504
|
194 |
*/ |
|
faluco@1504
|
195 |
native bool:DispatchKeyValueFloat(entity, const String:keyName[], Float:value); |
|
faluco@1504
|
196 |
|
|
faluco@1504
|
197 |
/** |
|
faluco@1504
|
198 |
* Dispatches a KeyValue into given entity using a vector value. |
|
faluco@1504
|
199 |
* |
|
faluco@1504
|
200 |
* @param entity Destination entity index. |
|
faluco@1504
|
201 |
* @param keyName Name of the key. |
|
faluco@1504
|
202 |
* @param vec Vector value. |
|
faluco@1504
|
203 |
* @return True on success, false otherwise. |
|
faluco@1504
|
204 |
* @error Invalid entity index, or no mod support. |
|
faluco@1504
|
205 |
*/ |
|
faluco@1504
|
206 |
native bool:DispatchKeyValueVector(entity, const String:keyName[], const Float:vector[3]); |
|
faluco@1504
|
207 |
|
|
faluco@1504
|
208 |
/** |
|
dvander@980
|
209 |
* @deprecated |
|
dvander@955
|
210 |
*/ |
|
ds@1268
|
211 |
#pragma deprecated Use IgniteEntity() instead |
|
dvander@980
|
212 |
stock IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false) |
|
dvander@980
|
213 |
{ |
|
dvander@980
|
214 |
return IgniteEntity(client, time, npc, size, level); |
|
dvander@980
|
215 |
} |
|
dvander@980
|
216 |
|
|
dvander@980
|
217 |
/** |
|
dvander@980
|
218 |
* @deprecated |
|
dvander@980
|
219 |
*/ |
|
ds@1268
|
220 |
#pragma deprecated Use ExtinguishEntity() instead |
|
dvander@980
|
221 |
stock ExtinguishClient(client) |
|
dvander@980
|
222 |
{ |
|
dvander@980
|
223 |
return ExtinguishEntity(client); |
|
dvander@980
|
224 |
} |
|
dvander@980
|
225 |
|
|
dvander@980
|
226 |
/** |
|
dvander@980
|
227 |
* @deprecated |
|
dvander@980
|
228 |
*/ |
|
ds@1268
|
229 |
#pragma deprecated Use TeleportEntity() instead |
|
dvander@980
|
230 |
stock TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3]) |
|
dvander@980
|
231 |
{ |
|
dvander@980
|
232 |
return TeleportEntity(client, origin, angles, velocity); |
|
dvander@980
|
233 |
} |