plugins/include/clients.inc
author David Anderson <dvander@alliedmods.net>
Sun Apr 06 08:20:02 2008 +0000 (2008-04-06)
changeset 1970 316eff8d8164
parent 1952 b7aa2b626807
child 2054 31593cdc67c7
permissions -rw-r--r--
added regex versioning to windows
ds@1952
     1
/**
ds@1952
     2
 * vim: set ts=4 :
ds@1952
     3
 * =============================================================================
ds@1952
     4
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
ds@1952
     5
 * =============================================================================
ds@1952
     6
 *
ds@1952
     7
 * This file is part of the SourceMod/SourcePawn SDK.
ds@1952
     8
 *
ds@1952
     9
 * This program is free software; you can redistribute it and/or modify it under
ds@1952
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1952
    11
 * Free Software Foundation.
ds@1952
    12
 * 
ds@1952
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1952
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1952
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1952
    16
 * details.
ds@1952
    17
 *
ds@1952
    18
 * You should have received a copy of the GNU General Public License along with
ds@1952
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
ds@1952
    20
 *
ds@1952
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1952
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1952
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1952
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1952
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1952
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1952
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1952
    28
 * or <http://www.sourcemod.net/license.php>.
ds@1952
    29
 *
ds@1952
    30
 * Version: $Id$
ds@1952
    31
 */
ds@1952
    32
ds@1952
    33
#if defined _clients_included
ds@1952
    34
 #endinput
ds@1952
    35
#endif
ds@1952
    36
#define _clients_included
ds@1952
    37
ds@1952
    38
enum NetFlow
ds@1952
    39
{
ds@1952
    40
	NetFlow_Outgoing = 0,	/**< Outgoing traffic */
ds@1952
    41
	NetFlow_Incoming,		/**< Incoming traffic */
ds@1952
    42
	NetFlow_Both			/**< Incoming and outgoing traffic */
ds@1952
    43
};
ds@1952
    44
ds@1952
    45
#define MAXPLAYERS		64	/**< Maximum number of players that can be in server */
ds@1952
    46
#define MAX_NAME_LENGTH 32	/**< Maximum buffer required to store a client name */
ds@1952
    47
ds@1952
    48
/**
ds@1952
    49
 * Called on client connection.
ds@1952
    50
 *
ds@1952
    51
 * @param client		Client index.
ds@1952
    52
 * @param rejectmsg		Buffer to store the rejection message when the connection is refused.
ds@1952
    53
 * @param maxlen		Maximum number of characters for rejection buffer.
ds@1952
    54
 * @return				True to validate client's connection, false to refuse it.
ds@1952
    55
 */
ds@1952
    56
forward bool:OnClientConnect(client, String:rejectmsg[], maxlen);
ds@1952
    57
ds@1952
    58
/**
ds@1952
    59
 * Called when a client is entering the game.
ds@1952
    60
 *
ds@1952
    61
 * Whether a client has a steamid is undefined until OnClientAuthorized
ds@1952
    62
 * is called, which may occur either before or after OnClientPutInServer.
ds@1952
    63
 * Similarly, use OnClientPostAdminCheck() if you need to verify whether 
ds@1952
    64
 * connecting players are admins.
ds@1952
    65
 *
ds@1952
    66
 * GetClientCount() will include clients as they are passed through this 
ds@1952
    67
 * function, as clients are already in game at this point.
ds@1952
    68
 *
ds@1952
    69
 * @param client		Client index.
ds@1952
    70
 * @noreturn
ds@1952
    71
 */
ds@1952
    72
forward OnClientPutInServer(client);
ds@1952
    73
ds@1952
    74
/**
ds@1952
    75
 * Called when a client is disconnecting from the server.
ds@1952
    76
 *
ds@1952
    77
 * @param client		Client index.
ds@1952
    78
 * @noreturn
ds@1952
    79
 */
ds@1952
    80
forward OnClientDisconnect(client);
ds@1952
    81
ds@1952
    82
/**
ds@1952
    83
 * Called when a client is disconnected from the server.
ds@1952
    84
 *
ds@1952
    85
 * @param client		Client index.
ds@1952
    86
 * @noreturn
ds@1952
    87
 */
ds@1952
    88
forward OnClientDisconnect_Post(client);
ds@1952
    89
ds@1952
    90
/**
ds@1952
    91
 * Called when a client is sending a command.
ds@1952
    92
 *
ds@1952
    93
 * @param client		Client index.
ds@1952
    94
 * @param args			Number of arguments.
ds@1952
    95
 * @noreturn
ds@1952
    96
 */
ds@1952
    97
forward Action:OnClientCommand(client, args);
ds@1952
    98
ds@1952
    99
/**
ds@1952
   100
 * Called whenever the client's settings are changed.
ds@1952
   101
 *
ds@1952
   102
 * @param client		Client index.
ds@1952
   103
 * @noreturn
ds@1952
   104
 */
ds@1952
   105
forward OnClientSettingsChanged(client);
ds@1952
   106
ds@1952
   107
/**
ds@1952
   108
 * Called when a client receives a Steam ID.  The state of a client's 
ds@1952
   109
 * authorization via Steam or as an admin is not guaranteed here.  
ds@1952
   110
 * Use OnClientAuthorized() or OnClientPostAdminCheck() for those, 
ds@1952
   111
 * respectively.
ds@1952
   112
 *
ds@1952
   113
 * This is called by bots, but the ID will be "BOT".
ds@1952
   114
 *
ds@1952
   115
 * @param client		Client index.
ds@1952
   116
 * @param auth			Client auth string.
ds@1952
   117
 * @noreturn
ds@1952
   118
 */
ds@1952
   119
forward OnClientAuthorized(client, const String:auth[]);
ds@1952
   120
ds@1952
   121
/**
ds@1952
   122
 * Called once a client is authorized and fully in-game, but 
ds@1952
   123
 * before admin checks are done.  This can be used to override 
ds@1952
   124
 * the default admin checks for a client.  You should only use 
ds@1952
   125
 * this for overriding; use OnClientPostAdminCheck() instead 
ds@1952
   126
 * if you want notification.
ds@1952
   127
 *
ds@1952
   128
 * Note: If handled/blocked, PostAdminCheck must be signalled 
ds@1952
   129
 * manually via NotifyPostAdminCheck().
ds@1952
   130
 *
ds@1952
   131
 * This callback is gauranteed to occur on all clients, and always 
ds@1952
   132
 * after each OnClientPutInServer() call.
ds@1952
   133
 *
ds@1952
   134
 * @param client		Client index.
ds@1952
   135
 * @return				Plugin_Handled to block admin checks.
ds@1952
   136
 */
ds@1952
   137
forward Action:OnClientPreAdminCheck(client);
ds@1952
   138
ds@1952
   139
/**
ds@1952
   140
 * Called directly before OnClientPostAdminCheck() as a method to 
ds@1952
   141
 * alter administrative permissions before plugins perform final 
ds@1952
   142
 * post-connect operations.  
ds@1952
   143
 *
ds@1952
   144
 * In general, do not use this function unless you are specifically 
ds@1952
   145
 * attempting to change access permissions.  Use OnClientPostAdminCheck() 
ds@1952
   146
 * instead if you simply want to perform post-connect authorization 
ds@1952
   147
 * routines.
ds@1952
   148
 *
ds@1952
   149
 * See OnClientPostAdminCheck() for more information.
ds@1952
   150
 *
ds@1952
   151
 * @param client		Client index.
ds@1952
   152
 * @noreturn
ds@1952
   153
 */
ds@1952
   154
forward OnClientPostAdminFilter(client);
ds@1952
   155
ds@1952
   156
/**
ds@1952
   157
 * Called once a client is authorized and fully in-game, and 
ds@1952
   158
 * after all post-connection authorizations have been performed.  
ds@1952
   159
 *
ds@1952
   160
 * This callback is gauranteed to occur on all clients, and always 
ds@1952
   161
 * after each OnClientPutInServer() call.
ds@1952
   162
 *
ds@1952
   163
 * @param client		Client index.
ds@1952
   164
 * @noreturn
ds@1952
   165
 */
ds@1952
   166
forward OnClientPostAdminCheck(client);
ds@1952
   167
ds@1952
   168
/**
ds@1952
   169
 * Returns the maximum number of clients allowed on the server.  This may 
ds@1952
   170
 * return 0 if called before OnMapStart(), and thus should not be called 
ds@1952
   171
 * in OnPluginStart().  
ds@1952
   172
 *
ds@1952
   173
 * @return				Maximum number of clients allowed.
ds@1952
   174
 */
ds@1952
   175
native GetMaxClients();
ds@1952
   176
ds@1952
   177
/**
ds@1952
   178
 * Returns the client count put in the server.
ds@1952
   179
 *
ds@1952
   180
 * @param inGameOnly	If false connecting players are also counted.
ds@1952
   181
 * @return				Client count in the server.
ds@1952
   182
 */
ds@1952
   183
native GetClientCount(bool:inGameOnly=true);
ds@1952
   184
ds@1952
   185
/**
ds@1952
   186
 * Returns the client's name.
ds@1952
   187
 *
ds@1952
   188
 * @param client		Player index.
ds@1952
   189
 * @param name			Buffer to store the client's name.
ds@1952
   190
 * @param maxlen		Maximum length of string buffer (includes NULL terminator).
ds@1952
   191
 * @return				True on success, false otherwise.
ds@1952
   192
 * @error				If the client is not connected an error will be thrown.
ds@1952
   193
 */
ds@1952
   194
native bool:GetClientName(client, String:name[], maxlen);
ds@1952
   195
ds@1952
   196
/**
ds@1952
   197
 * Retrieves a client's IP address.
ds@1952
   198
 *
ds@1952
   199
 * @param client		Player index.
ds@1952
   200
 * @param name			Buffer to store the client's ip address.
ds@1952
   201
 * @param maxlen		Maximum length of string buffer (includes NULL terminator).
ds@1952
   202
 * @param remport		Remove client's port from the ip string (true by default).
ds@1952
   203
 * @return				True on success, false otherwise.
ds@1952
   204
 * @error				If the client is not connected or the index is invalid.
ds@1952
   205
 */
ds@1952
   206
native bool:GetClientIP(client, String:ip[], maxlen, bool:remport=true);
ds@1952
   207
ds@1952
   208
/**
ds@1952
   209
 * Retrieves a client's authentication string (SteamID).
ds@1952
   210
 *
ds@1952
   211
 * @param client		Player index.
ds@1952
   212
 * @param auth			Buffer to store the client's auth string.
ds@1952
   213
 * @param maxlen		Maximum length of string buffer (includes NULL terminator).
ds@1952
   214
 * @return				True on success, false otherwise.
ds@1952
   215
 * @error				If the client is not connected or the index is invalid.
ds@1952
   216
 */
ds@1952
   217
native bool:GetClientAuthString(client, String:auth[], maxlen);
ds@1952
   218
ds@1952
   219
/**
ds@1952
   220
 * Retrieves a client's user id, which is an index incremented for every client
ds@1952
   221
 * that joins the server.
ds@1952
   222
 *
ds@1952
   223
 * @param client		Player index.
ds@1952
   224
 * @return				User id of the client.
ds@1952
   225
 * @error 				If the client is not connected or the index is invalid.
ds@1952
   226
 */
ds@1952
   227
native GetClientUserId(client);
ds@1952
   228
ds@1952
   229
/**
ds@1952
   230
 * Returns if a certain player is connected.
ds@1952
   231
 *
ds@1952
   232
 * @param client		Player index.
ds@1952
   233
 * @return				True if player is connected to the server, false otherwise.
ds@1952
   234
 */
ds@1952
   235
native bool:IsClientConnected(client);
ds@1952
   236
ds@1952
   237
/**
ds@1952
   238
 * Returns if a certain player has entered the game.
ds@1952
   239
 *
ds@1952
   240
 * @param client		Player index (index does not have to be connected).
ds@1952
   241
 * @return				True if player has entered the game, false otherwise.
ds@1952
   242
 * @error				Invalid client index.
ds@1952
   243
 */
ds@1952
   244
native bool:IsClientInGame(client);
ds@1952
   245
ds@1952
   246
/**
ds@1952
   247
 * Returns if a client is in the "kick queue" (i.e. the client will be kicked 
ds@1952
   248
 * shortly and thus they should not appear as valid).
ds@1952
   249
 *
ds@1952
   250
 * @param client		Player index (must be connected).
ds@1952
   251
 * @return				True if in the kick queue, false otherwise.
ds@1952
   252
 * @error				Invalid client index.
ds@1952
   253
 */
ds@1952
   254
native bool:IsClientInKickQueue(client);
ds@1952
   255
ds@1952
   256
/**
ds@1952
   257
 * Backwards compatibility stock - use IsClientInGame
ds@1952
   258
 * @deprecated			Renamed to IsClientInGame
ds@1952
   259
 */
ds@1952
   260
#pragma deprecated Use IsClientInGame() instead
ds@1952
   261
stock bool:IsPlayerInGame(client)
ds@1952
   262
{
ds@1952
   263
	return IsClientInGame(client);
ds@1952
   264
}
ds@1952
   265
ds@1952
   266
/**
ds@1952
   267
 * Returns if a certain player has been authenticated.
ds@1952
   268
 *
ds@1952
   269
 * @param client		Player index.
ds@1952
   270
 * @return				True if player has been authenticated, false otherwise.
ds@1952
   271
 */
ds@1952
   272
native bool:IsClientAuthorized(client);
ds@1952
   273
ds@1952
   274
/**
ds@1952
   275
 * Returns if a certain player is a fake client.
ds@1952
   276
 *
ds@1952
   277
 * @param client		Player index.
ds@1952
   278
 * @return				True if player is a fake client, false otherwise.
ds@1952
   279
 */
ds@1952
   280
native bool:IsFakeClient(client);
ds@1952
   281
ds@1952
   282
/**
ds@1952
   283
 * Returns if a certain player is an observer/spectator.
ds@1952
   284
 *
ds@1952
   285
 * @param client		Player index.
ds@1952
   286
 * @return				True if player is an obverser, false otherwise.
ds@1952
   287
 */
ds@1952
   288
native bool:IsClientObserver(client);
ds@1952
   289
ds@1952
   290
/**
ds@1952
   291
 * Returns if the client is alive or dead.
ds@1952
   292
 *
ds@1952
   293
 * Note: This function was originally in SDKTools and was moved to core.
ds@1952
   294
 *
ds@1952
   295
 * @param client		Player's index.
ds@1952
   296
 * @return				True if the client is alive, false otherwise.
ds@1952
   297
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   298
 */
ds@1952
   299
native bool:IsPlayerAlive(client);
ds@1952
   300
ds@1952
   301
/**
ds@1952
   302
 * Retrieves values from client replicated keys.
ds@1952
   303
 *
ds@1952
   304
 * @param client		Player's index.
ds@1952
   305
 * @param key			Key string.
ds@1952
   306
 * @param value			Buffer to store value.
ds@1952
   307
 * @param maxlen		Maximum length of valve (UTF-8 safe).
ds@1952
   308
 * @return 				True on success, false otherwise.
ds@1952
   309
 * @error				Invalid client index, or client not connected.
ds@1952
   310
 */
ds@1952
   311
native bool:GetClientInfo(client, const String:key[], String:value[], maxlen);
ds@1952
   312
ds@1952
   313
/**
ds@1952
   314
 * Retrieves a client's team index.
ds@1952
   315
 *
ds@1952
   316
 * @param client		Player's index.
ds@1952
   317
 * @return				Team index the client is on (mod specific).
ds@1952
   318
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   319
 */
ds@1952
   320
native GetClientTeam(client);
ds@1952
   321
 
ds@1952
   322
/**
ds@1952
   323
 * Sets a client's AdminId.  
ds@1952
   324
 *
ds@1952
   325
 * @param client		Player's index.
ds@1952
   326
 * @param id			AdminId to set.  INVALID_ADMIN_ID removes admin permissions.
ds@1952
   327
 * @param temp			True if the id should be freed on disconnect.
ds@1952
   328
 * @noreturn
ds@1952
   329
 * @error				Invalid client index, client not connected, or bogus AdminId.
ds@1952
   330
 */
ds@1952
   331
native SetUserAdmin(client, AdminId:id, bool:temp=false);
ds@1952
   332
ds@1952
   333
/**
ds@1952
   334
 * Retrieves a client's AdminId.
ds@1952
   335
 *
ds@1952
   336
 * @param client		Player's index.
ds@1952
   337
 * @return				AdminId of the client, or INVALID_ADMIN_ID if none.
ds@1952
   338
 * @error				Invalid client index, or client not connected.
ds@1952
   339
 */
ds@1952
   340
native AdminId:GetUserAdmin(client);
ds@1952
   341
ds@1952
   342
/**
ds@1952
   343
 * Sets access flags on a client.  If the client is not an admin,
ds@1952
   344
 * a temporary, anonymous AdminId is given.
ds@1952
   345
 *
ds@1952
   346
 * @param client		Player's index.
ds@1952
   347
 * @param ...			Flags to set on the client.
ds@1952
   348
 * @noreturn
ds@1952
   349
 * @error				Invalid client index, or client not connected.
ds@1952
   350
 */
ds@1952
   351
native AddUserFlags(client, AdminFlag:...);
ds@1952
   352
ds@1952
   353
/**
ds@1952
   354
 * Removes flags from a client.  If the client is not an admin,
ds@1952
   355
 * this has no effect.
ds@1952
   356
 *
ds@1952
   357
 * @param client		Player's index.
ds@1952
   358
 * @param ...			Flags to remove from the client.
ds@1952
   359
 * @noreturn
ds@1952
   360
 * @error				Invalid client index, or client not connected.
ds@1952
   361
 */
ds@1952
   362
native RemoveUserFlags(client, AdminFlag:...);
ds@1952
   363
ds@1952
   364
/** 
ds@1952
   365
 * Sets access flags on a client using bits instead of flags.  If the
ds@1952
   366
 * client is not an admin, and flags not 0, a temporary, anonymous AdminId is given.
ds@1952
   367
 *
ds@1952
   368
 * @param client		Player's index.
ds@1952
   369
 * @param flags			Bitstring of flags to set on client.
ds@1952
   370
 * @noreturn
ds@1952
   371
 */
ds@1952
   372
native SetUserFlagBits(client, flags);
ds@1952
   373
ds@1952
   374
/**
ds@1952
   375
 * Returns client access flags.  If the client is not an admin,
ds@1952
   376
 * the result is always 0.
ds@1952
   377
 * 
ds@1952
   378
 * @param client		Player's index.
ds@1952
   379
 * @return				Flags
ds@1952
   380
 * @error				Invalid client index, or client not connected.
ds@1952
   381
 */
ds@1952
   382
native GetUserFlagBits(client);
ds@1952
   383
ds@1952
   384
/**
ds@1952
   385
 * Returns whether a user can target another user.
ds@1952
   386
 * This is a helper function for CanAdminTarget.
ds@1952
   387
 *
ds@1952
   388
 * @param client		Player's index.
ds@1952
   389
 * @param target		Target player's index.
ds@1952
   390
 * @return				True if target is targettable by the player, false otherwise.
ds@1952
   391
 * @error				Invalid or unconnected player indexers.
ds@1952
   392
 */
ds@1952
   393
native bool:CanUserTarget(client, target);
ds@1952
   394
ds@1952
   395
/**
ds@1952
   396
 * Runs through the Core-defined admin authorization checks on a player.
ds@1952
   397
 * Has no effect if the player is already an admin.
ds@1952
   398
 *
ds@1952
   399
 * Note: This function is based on the internal cache only.
ds@1952
   400
 *
ds@1952
   401
 * @param client		Client index.
ds@1952
   402
 * @return				True if access was changed, false if it did not.
ds@1952
   403
 * @error				Invalid client index or client not in-game AND authorized.
ds@1952
   404
 */
ds@1952
   405
native bool:RunAdminCacheChecks(client);
ds@1952
   406
ds@1952
   407
/**
ds@1952
   408
 * Signals that a player has completed post-connection admin checks.
ds@1952
   409
 * Has no effect if the player has already had this event signalled.
ds@1952
   410
 *
ds@1952
   411
 * Note: This must be sent even if no admin id was assigned.
ds@1952
   412
 *
ds@1952
   413
 * @param client		Client index.
ds@1952
   414
 * @noreturn
ds@1952
   415
 * @error				Invalid client index or client not in-game AND authorized.
ds@1952
   416
 */
ds@1952
   417
native NotifyPostAdminCheck(client);
ds@1952
   418
ds@1952
   419
/** 
ds@1952
   420
 * Creates a fake client.
ds@1952
   421
 *
ds@1952
   422
 * @param name			Name to use.
ds@1952
   423
 * @return				Client index on success, 0 otherwise.
ds@1952
   424
 */
ds@1952
   425
native CreateFakeClient(const String:name[]);
ds@1952
   426
ds@1952
   427
/**
ds@1952
   428
 * Sets a convar value on a fake client.
ds@1952
   429
 *
ds@1952
   430
 * @param client		Client index.
ds@1952
   431
 * @param cvar			ConVar name.
ds@1952
   432
 * @param value			ConVar value.
ds@1952
   433
 * @noreturn
ds@1952
   434
 * @error				Invalid client index, client not connected,
ds@1952
   435
 *						or client not a fake client.
ds@1952
   436
 */
ds@1952
   437
native SetFakeClientConVar(client, const String:cvar[], const String:value[]);
ds@1952
   438
ds@1952
   439
/**
ds@1952
   440
 * Returns the client's health.
ds@1952
   441
 *
ds@1952
   442
 * @param client		Player's index.
ds@1952
   443
 * @return				Health value.
ds@1952
   444
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   445
 */
ds@1952
   446
native GetClientHealth(client);
ds@1952
   447
ds@1952
   448
/**
ds@1952
   449
 * Returns the client's model name.
ds@1952
   450
 *
ds@1952
   451
 * @param client		Player's index.
ds@1952
   452
 * @param model			Buffer to store the client's model name.
ds@1952
   453
 * @param maxlen		Maximum length of string buffer (includes NULL terminator).
ds@1952
   454
 * @noreturn
ds@1952
   455
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   456
 */
ds@1952
   457
native GetClientModel(client, String:model[], maxlen);
ds@1952
   458
ds@1952
   459
/**
ds@1952
   460
 * Returns the client's weapon name.
ds@1952
   461
 *
ds@1952
   462
 * @param client		Player's index.
ds@1952
   463
 * @param weapon		Buffer to store the client's weapon name.
ds@1952
   464
 * @param maxlen		Maximum length of string buffer (includes NULL terminator).
ds@1952
   465
 * @noreturn
ds@1952
   466
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   467
 */
ds@1952
   468
native GetClientWeapon(client, String:weapon[], maxlen);
ds@1952
   469
ds@1952
   470
/**
ds@1952
   471
 * Returns the client's max size vector.
ds@1952
   472
 *
ds@1952
   473
 * @param client		Player's index.
ds@1952
   474
 * @param vec			Destination vector to store the client's max size.
ds@1952
   475
 * @noreturn
ds@1952
   476
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   477
 */
ds@1952
   478
native GetClientMaxs(client, Float:vec[3]);
ds@1952
   479
ds@1952
   480
/**
ds@1952
   481
 * Returns the client's min size vector.
ds@1952
   482
 *
ds@1952
   483
 * @param client		Player's index.
ds@1952
   484
 * @param vec			Destination vector to store the client's min size.
ds@1952
   485
 * @noreturn
ds@1952
   486
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   487
 */
ds@1952
   488
native GetClientMins(client, Float:vec[3]);
ds@1952
   489
ds@1952
   490
/**
ds@1952
   491
 * Returns the client's position angle.
ds@1952
   492
 *
ds@1952
   493
 * @param client		Player's index.
ds@1952
   494
 * @param ang			Destination vector to store the client's position angle.
ds@1952
   495
 * @noreturn
ds@1952
   496
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   497
 */
ds@1952
   498
native GetClientAbsAngles(client, Float:ang[3]);
ds@1952
   499
ds@1952
   500
/**
ds@1952
   501
 * Returns the client's origin vector.
ds@1952
   502
 *
ds@1952
   503
 * @param client		Player's index.
ds@1952
   504
 * @param vec			Destination vector to store the client's origin vector.
ds@1952
   505
 * @noreturn
ds@1952
   506
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   507
 */
ds@1952
   508
native GetClientAbsOrigin(client, Float:vec[3]);
ds@1952
   509
ds@1952
   510
/**
ds@1952
   511
 * Returns the client's armor.
ds@1952
   512
 *
ds@1952
   513
 * @param client		Player's index.
ds@1952
   514
 * @return				Armor value.
ds@1952
   515
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   516
 */
ds@1952
   517
native GetClientArmor(client);
ds@1952
   518
ds@1952
   519
/**
ds@1952
   520
 * Returns the client's death count.
ds@1952
   521
 *
ds@1952
   522
 * @param client		Player's index.
ds@1952
   523
 * @return				Death count.
ds@1952
   524
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   525
 */
ds@1952
   526
native GetClientDeaths(client);
ds@1952
   527
ds@1952
   528
/**
ds@1952
   529
 * Returns the client's frag count.
ds@1952
   530
 *
ds@1952
   531
 * @param client		Player's index.
ds@1952
   532
 * @return				Frag count.
ds@1952
   533
 * @error				Invalid client index, client not in game, or no mod support.
ds@1952
   534
 */
ds@1952
   535
native GetClientFrags(client);
ds@1952
   536
ds@1952
   537
/**
ds@1952
   538
 * Returns the client's send data rate in bytes/sec.
ds@1952
   539
 *
ds@1952
   540
 * @param client		Player's index.
ds@1952
   541
 * @return				Data rate.
ds@1952
   542
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   543
 */
ds@1952
   544
native GetClientDataRate(client);
ds@1952
   545
ds@1952
   546
/**
ds@1952
   547
 * Returns if a client is timing out
ds@1952
   548
 *
ds@1952
   549
 * @param client		Player's index.
ds@1952
   550
 * @return				True if client is timing out, false otherwise.
ds@1952
   551
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   552
 */
ds@1952
   553
native bool:IsClientTimingOut(client);
ds@1952
   554
ds@1952
   555
/**
ds@1952
   556
 * Returns the client's connection time in seconds.
ds@1952
   557
 *
ds@1952
   558
 * @param client		Player's index.
ds@1952
   559
 * @return				Connection time.
ds@1952
   560
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   561
 */
ds@1952
   562
native Float:GetClientTime(client);
ds@1952
   563
ds@1952
   564
/**
ds@1952
   565
 * Returns the client's current latency (RTT), more accurate than GetAvgLatency but jittering.
ds@1952
   566
 *
ds@1952
   567
 * @param client		Player's index.
ds@1952
   568
 * @param flow			Traffic flowing direction.
ds@1952
   569
 * @return				Latency.
ds@1952
   570
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   571
 */
ds@1952
   572
native Float:GetClientLatency(client, NetFlow:flow);
ds@1952
   573
ds@1952
   574
/**
ds@1952
   575
 * Returns the client's average packet latency in seconds.
ds@1952
   576
 *
ds@1952
   577
 * @param client		Player's index.
ds@1952
   578
 * @param flow			Traffic flowing direction.
ds@1952
   579
 * @return				Average latency.
ds@1952
   580
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   581
 */
ds@1952
   582
native Float:GetClientAvgLatency(client, NetFlow:flow);
ds@1952
   583
ds@1952
   584
/**
ds@1952
   585
 * Returns the client's average packet loss, values go from 0 to 1 (for percentages).
ds@1952
   586
 *
ds@1952
   587
 * @param client		Player's index.
ds@1952
   588
 * @param flow			Traffic flowing direction.
ds@1952
   589
 * @return				Average packet loss.
ds@1952
   590
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   591
 */
ds@1952
   592
native Float:GetClientAvgLoss(client, NetFlow:flow);
ds@1952
   593
ds@1952
   594
/**
ds@1952
   595
 * Returns the client's average packet choke, values go from 0 to 1 (for percentages).
ds@1952
   596
 *
ds@1952
   597
 * @param client		Player's index.
ds@1952
   598
 * @param flow			Traffic flowing direction.
ds@1952
   599
 * @return				Average packet choke.
ds@1952
   600
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   601
 */
ds@1952
   602
native Float:GetClientAvgChoke(client, NetFlow:flow);
ds@1952
   603
ds@1952
   604
/**
ds@1952
   605
 * Returns the client's data flow in bytes/sec.
ds@1952
   606
 *
ds@1952
   607
 * @param client		Player's index.
ds@1952
   608
 * @param flow			Traffic flowing direction.
ds@1952
   609
 * @return				Data flow.
ds@1952
   610
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   611
 */
ds@1952
   612
native Float:GetClientAvgData(client, NetFlow:flow);
ds@1952
   613
ds@1952
   614
/**
ds@1952
   615
 * Returns the client's average packet frequency in packets/sec.
ds@1952
   616
 *
ds@1952
   617
 * @param client		Player's index.
ds@1952
   618
 * @param flow			Traffic flowing direction.
ds@1952
   619
 * @return				Packet frequency.
ds@1952
   620
 * @error				Invalid client index, client not in game, or fake client.
ds@1952
   621
 */
ds@1952
   622
native Float:GetClientAvgPackets(client, NetFlow:flow);
ds@1952
   623
ds@1952
   624
/**
ds@1952
   625
 * Translates an userid index to the real player index.
ds@1952
   626
 *
ds@1952
   627
 * @param userid		Userid value.
ds@1952
   628
 * @return				Client value.
ds@1952
   629
 * @error				Returns 0 if invalid userid.
ds@1952
   630
 */
ds@1952
   631
native GetClientOfUserId(userid);
ds@1952
   632
ds@1952
   633
/**
ds@1952
   634
 * Disconnects a client from the server.  
ds@1952
   635
 *
ds@1952
   636
 * Kicking clients from certain events or callbacks may cause crashes.  If in 
ds@1952
   637
 * doubt, create a short (0.1 second) timer to kick the client in the next 
ds@1952
   638
 * available frame.
ds@1952
   639
 *
ds@1952
   640
 * @param client		Client index.
ds@1952
   641
 * @param format		Optional formatting rules for disconnect reason.
ds@1952
   642
 *                      Note that a period is automatically appended to the string by the engine.
ds@1952
   643
 * @param ...			Variable number of format parameters.
ds@1952
   644
 * @noreturn
ds@1952
   645
 * @error				Invalid client index, or client not connected.
ds@1952
   646
 */
ds@1952
   647
native KickClient(client, const String:format[]="", any:...);
ds@1952
   648
ds@1952
   649
/**
ds@1952
   650
 * Changes a client's team through the mod's generic team changing function.
ds@1952
   651
 * On CS:S, this will kill the player.
ds@1952
   652
 *
ds@1952
   653
 * @param client		Client index.
ds@1952
   654
 * @param team			Mod-specific team index.
ds@1952
   655
 * @noreturn
ds@1952
   656
 * @error				Invalid client index, client not connected, or lack of 
ds@1952
   657
 *						mod support.
ds@1952
   658
 */
ds@1952
   659
native ChangeClientTeam(client, team);
ds@1952
   660