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