Whoa, bug. Hopefully fixed PrintToChatAll and PrintCenterTextAll once and for all...
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 _clients_included
19 #define _clients_included
23 NetFlow_Outgoing = 0, /**< Outgoing traffic */
24 NetFlow_Incoming, /**< Incoming traffic */
25 NetFlow_Both /**< Incoming and outgoing traffic */
28 #define MAXPLAYERS 64 /**< Maximum number of players that can be in server */
31 * Called on client connection.
33 * @param client Player index.
34 * @param rejectmsg Buffer to store the rejection message when the connection is refused.
35 * @param maxlen Maximum number of characters for rejection buffer.
36 * @return True to validate client's connection, false to refuse it.
38 forward bool:OnClientConnect(client, String:rejectmsg[], maxlen);
41 * Called when a client is entering to the game.
43 * @param client Player index.
46 forward OnClientPutInServer(client);
49 * Called when a client is disconnecting from the server.
51 * @param client Player index.
54 forward OnClientDisconnect(client);
57 * Called when a client is disconnected from the server.
59 * @param client Player index.
62 forward OnClientDisconnect_Post(client);
65 * Called when a client is sending a command.
67 * @param client Player index.
68 * @param args Number of arguments.
71 forward Action:OnClientCommand(client, args);
74 * Called whenever the client's settings are changed.
76 * @param client Player index.
79 forward OnClientSettingsChanged(client);
82 * Called when a client receives a Steam ID.
83 * @note This is called by bots, but the ID will be "BOT"
85 * @param client Player index.
86 * @param auth Player auth string.
88 forward OnClientAuthorized(client, const String:auth[]);
91 * Returns the maximum number of clients allowed on the server.
93 * @return Maximum number of clients allowed.
95 native GetMaxClients();
98 * Returns the client count put in the server.
100 * @param inGameOnly If false connecting players are also counted.
101 * @return Client count in the server.
103 native GetClientCount(bool:inGameOnly=true);
106 * Returns the client's name.
108 * @param client Player index.
109 * @param name Buffer to store the client's name.
110 * @param maxlen Maximum length of string buffer (includes NULL terminator).
111 * @return True on success, false otherwise.
112 * @error If the client is not connected an error will be thrown.
114 native bool:GetClientName(client, String:name[], maxlen);
117 * Retrieves a client's IP address.
119 * @param client Player index.
120 * @param name Buffer to store the client's ip address.
121 * @param maxlen Maximum length of string buffer (includes NULL terminator).
122 * @param remport Remove client's port from the ip string (true by default).
123 * @return True on success, false otherwise.
124 * @error If the client is not connected or the index is invalid.
126 native bool:GetClientIP(client, String:ip[], maxlen, bool:remport=true);
129 * Retrieves a client's authentication string (SteamID).
131 * @param client Player index.
132 * @param auth Buffer to store the client's auth string.
133 * @param maxlen Maximum length of string buffer (includes NULL terminator).
134 * @return True on success, false otherwise.
135 * @error If the client is not connected or the index is invalid.
137 native bool:GetClientAuthString(client, String:auth[], maxlen);
140 * Retrieves a client's user id, which is an index incremented for every client
141 * that joins the server.
143 * @param client Player index.
144 * @return User id of the client.
145 * @error If the client is not connected or the index is invalid.
147 native GetClientUserId(client);
150 * Returns if a certain player is connected.
152 * @param client Player index.
153 * @return True if player is connected to the server, false otherwise.
155 native bool:IsClientConnected(client);
158 * Returns if a certain player has entered the game.
160 * @param client Player index.
161 * @return True if player has entered the game, false otherwise.
163 native bool:IsClientInGame(client);
166 * Backwards compatibility stock - use IsClientInGame
167 * @deprecated Renamed to IsClientInGame
169 stock bool:IsPlayerInGame(client)
171 return IsClientInGame(client);
175 * Returns if a certain player has been authenticated.
177 * @param client Player index.
178 * @return True if player has been authenticated, false otherwise.
180 native bool:IsClientAuthorized(client);
183 * Returns if a certain player is a fake client.
185 * @param client Player index.
186 * @return True if player is a fake client, false otherwise.
188 native bool:IsFakeClient(client);
191 * Retrieves values from client replicated keys.
193 * @param client Player's index.
194 * @param key Key string.
195 * @param value Buffer to store value.
196 * @param maxlen Maximum length of valve (UTF-8 safe).
197 * @return True on success, false otherwise.
198 * @error Invalid client index, or client not connected.
200 native bool:GetClientInfo(client, const String:key[], String:value[], maxlen);
203 * Retrieves a client's team index.
205 * @param client Player's index.
206 * @return Team index the client is on (mod specific).
207 * @error Invalid client index, client not in game, or no mod support.
209 native GetClientTeam(client);
212 * Sets a client's AdminId.
214 * @param client Player's index.
215 * @param id AdminId to set. INVALID_ADMIN_ID removes admin permissions.
216 * @param temp True if the id should be freed on disconnect.
218 * @error Invalid client index, client not connected, or bogus AdminId.
220 native SetUserAdmin(client, AdminId:id, bool:temp=false);
223 * Retrieves a client's AdminId.
225 * @param client Player's index.
226 * @return AdminId of the client, or INVALID_ADMIN_ID if none.
227 * @error Invalid client index, or client not connected.
229 native AdminId:GetUserAdmin(client);
232 * Sets access flags on a client. If the client is not an admin,
233 * a temporary, anonymous AdminId is given.
235 * @param client Player's index.
236 * @param ... Flags to set on the client.
238 * @error Invalid client index, or client not connected.
240 native AddUserFlags(client, AdminFlag:...);
243 * Removes flags from a client. If the client is not an admin,
244 * this has no effect.
246 * @param client Player's index.
247 * @param ... Flags to remove from the client.
249 * @error Invalid client index, or client not connected.
251 native RemoveUserFlags(client, AdminFlag:...);
254 * Sets access flags on a client using bits instead of flags. If the
255 * client is not an admin, and flags not 0, a temporary, anonymous AdminId is given.
257 * @param client Player's index.
258 * @param flags Bitstring of flags to set on client.
261 native SetUserFlagBits(client, flags);
264 * Returns client access flags. If the client is not an admin,
265 * the result is always 0.
267 * @param client Player's index.
269 * @error Invalid client index, or client not connected.
271 native GetUserFlagBits(client);
274 * Returns whether a user can target another user.
275 * This is a helper function for CanAdminTarget.
277 * @param client Player's index.
278 * @param target Target player's index.
279 * @return True if target is targettable by the player, false otherwise.
280 * @error Invalid or unconnected player indexers.
282 native bool:CanUserTarget(client, target);
285 * Creates a fake client.
287 * @param name Name to use.
288 * @return Client index on success, 0 otherwise.
290 native CreateFakeClient(const String:name[]);
293 * Sets a convar value on a fake client.
295 * @param client Client index.
296 * @param cvar ConVar name.
297 * @param value ConVar value.
299 * @error Invalid client index, client not connected,
300 * or client not a fake client.
302 native SetFakeClientConVar(client, const String:cvar[], const String:value[]);
305 * Returns the client's health.
307 * @param client Player's index.
308 * @return Health value.
309 * @error Invalid client index, client not in game, or no mod support.
311 native GetClientHealth(client);
314 * Returns the client's model name.
316 * @param client Player's index.
317 * @param model Buffer to store the client's model name.
318 * @param maxlen Maximum length of string buffer (includes NULL terminator).
320 * @error Invalid client index, client not in game, or no mod support.
322 native GetClientModel(client, String:model[], maxlen);
325 * Returns the client's weapon name.
327 * @param client Player's index.
328 * @param weapon Buffer to store the client's weapon name.
329 * @param maxlen Maximum length of string buffer (includes NULL terminator).
331 * @error Invalid client index, client not in game, or no mod support.
333 native GetClientWeapon(client, String:weapon[], maxlen);
336 * Returns the client's max size vector.
338 * @param client Player's index.
339 * @param vec Destination vector to store the client's max size.
341 * @error Invalid client index, client not in game, or no mod support.
343 native GetClientMaxs(client, Float:vec[3]);
346 * Returns the client's min size vector.
348 * @param client Player's index.
349 * @param vec Destination vector to store the client's min size.
351 * @error Invalid client index, client not in game, or no mod support.
353 native GetClientMins(client, Float:vec[3]);
356 * Returns the client's position angle.
358 * @param client Player's index.
359 * @param ang Destination vector to store the client's position angle.
361 * @error Invalid client index, client not in game, or no mod support.
363 native GetClientAbsAngles(client, Float:ang[3]);
366 * Returns the client's origin vector.
368 * @param client Player's index.
369 * @param vec Destination vector to store the client's origin vector.
371 * @error Invalid client index, client not in game, or no mod support.
373 native GetClientAbsOrigin(client, Float:vec[3]);
376 * Returns the client's armor.
378 * @param client Player's index.
379 * @return Armor value.
380 * @error Invalid client index, client not in game, or no mod support.
382 native GetClientArmor(client);
385 * Returns the client's death count.
387 * @param client Player's index.
388 * @return Death count.
389 * @error Invalid client index, client not in game, or no mod support.
391 native GetClientDeaths(client);
394 * Returns the client's frag count.
396 * @param client Player's index.
397 * @return Frag count.
398 * @error Invalid client index, client not in game, or no mod support.
400 native GetClientFrags(client);
403 * Returns the client's send data rate in bytes/sec.
405 * @param client Player's index.
407 * @error Invalid client index, client not in game, or fake client.
409 native GetClientDataRate(client);
412 * Returns if a client is timing out
414 * @param client Player's index.
415 * @return True if client is timing out, false otherwise.
416 * @error Invalid client index, client not in game, or fake client.
418 native bool:IsClientTimingOut(client);
421 * Returns the client's connection time in seconds.
423 * @param client Player's index.
424 * @return Connection time.
425 * @error Invalid client index, client not in game, or fake client.
427 native Float:GetClientTime(client);
430 * Returns the client's current latency (RTT), more accurate than GetAvgLatency but jittering.
432 * @param client Player's index.
433 * @param flow Traffic flowing direction.
435 * @error Invalid client index, client not in game, or fake client.
437 native Float:GetClientLatency(client, NetFlow:flow);
440 * Returns the client's average packet latency in seconds.
442 * @param client Player's index.
443 * @param flow Traffic flowing direction.
444 * @return Average latency.
445 * @error Invalid client index, client not in game, or fake client.
447 native Float:GetClientAvgLatency(client, NetFlow:flow);
450 * Returns the client's average packet loss, values go from 0 to 1 (for percentages).
452 * @param client Player's index.
453 * @param flow Traffic flowing direction.
454 * @return Average packet loss.
455 * @error Invalid client index, client not in game, or fake client.
457 native Float:GetClientAvgLoss(client, NetFlow:flow);
460 * Returns the client's average packet choke, values go from 0 to 1 (for percentages).
462 * @param client Player's index.
463 * @param flow Traffic flowing direction.
464 * @return Average packet choke.
465 * @error Invalid client index, client not in game, or fake client.
467 native Float:GetClientAvgChoke(client, NetFlow:flow);
470 * Returns the client's data flow in bytes/sec.
472 * @param client Player's index.
473 * @param flow Traffic flowing direction.
475 * @error Invalid client index, client not in game, or fake client.
477 native Float:GetClientAvgData(client, NetFlow:flow);
480 * Returns the client's average packet frequency in packets/sec.
482 * @param client Player's index.
483 * @param flow Traffic flowing direction.
484 * @return Packet frequency.
485 * @error Invalid client index, client not in game, or fake client.
487 native Float:GetClientAvgPackets(client, NetFlow:flow);
490 * Translates an userid index to the real player index.
492 * @param userid Userid value.
493 * @return Client value.
494 * @error Returns 0 if invalid userid.
496 native GetClientOfUserId(userid);