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