plugins/include/halflife.inc
author Ruben Gonzalez <drifter01620@gmail.com>
Thu May 22 09:49:27 2014 -0400 (2014-05-22)
changeset 4378 568f4497ef4a
parent 4301 5a9c242fa868
permissions -rw-r--r--
Update CS:GO team score gamedata.
     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 _halflife_included
    34  #endinput
    35 #endif
    36 #define _halflife_included
    37 
    38 #define SOURCE_SDK_UNKNOWN			0		/**< Could not determine the engine version */
    39 #define SOURCE_SDK_ORIGINAL			10		/**< Original Source engine (still used by "The Ship") */
    40 #define SOURCE_SDK_DARKMESSIAH		15		/**< Modified version of original engine used by Dark Messiah (no SDK) */
    41 #define SOURCE_SDK_EPISODE1			20		/**< SDK+Engine released after Episode 1 */
    42 #define SOURCE_SDK_EPISODE2			30		/**< SDK+Engine released after Episode 2/Orange Box */
    43 #define SOURCE_SDK_BLOODYGOODTIME	32		/**< Modified version of ep2 engine used by Bloody Good Time (no SDK) */
    44 #define SOURCE_SDK_EYE				33		/**< Modified version of ep2 engine used by E.Y.E Divine Cybermancy (no SDK) */
    45 #define SOURCE_SDK_CSS				34		/**< Sometime-older version of Source 2009 SDK+Engine, used for Counter-Strike: Source */
    46 #define SOURCE_SDK_EPISODE2VALVE	35		/**< SDK+Engine released after Episode 2/Orange Box, "Source 2009" or "Source MP" */
    47 #define SOURCE_SDK_LEFT4DEAD		40		/**< Engine released after Left 4 Dead (no SDK yet) */
    48 #define SOURCE_SDK_LEFT4DEAD2		50		/**< Engine released after Left 4 Dead 2 (no SDK yet) */
    49 #define SOURCE_SDK_ALIENSWARM		60		/**< SDK+Engine released after Alien Swarm */
    50 #define SOURCE_SDK_CSGO				80		/**< Engine released after CS:GO (no SDK yet) */
    51 #define SOURCE_SDK_DOTA				90		/**< Engine released after Dota 2 (no SDK) */
    52 
    53 #define MOTDPANEL_TYPE_TEXT		0	/**< Treat msg as plain text */
    54 #define MOTDPANEL_TYPE_INDEX	1	/**< Msg is auto determined by the engine */
    55 #define MOTDPANEL_TYPE_URL		2	/**< Treat msg as an URL link */
    56 #define MOTDPANEL_TYPE_FILE		3	/**< Treat msg as a filename to be openned */
    57 
    58 enum DialogType
    59 {
    60 	DialogType_Msg = 0,		/**< just an on screen message */
    61 	DialogType_Menu, 		/**< an options menu */
    62 	DialogType_Text, 		/**< a richtext dialog */
    63 	DialogType_Entry, 		/**< an entry box */
    64 	DialogType_AskConnect	/**< ask the client to connect to a specified IP */
    65 };
    66 
    67 enum EngineVersion
    68 {
    69 	Engine_Unknown,				/**< Could not determine the engine version */
    70 	Engine_Original,				/**< Original Source Engine (used by The Ship) */
    71 	Engine_SourceSDK2006,		/**< Episode 1 Source Engine (second major SDK) */
    72 	Engine_SourceSDK2007,		/**< Orange Box Source Engine (third major SDK) */
    73 	Engine_Left4Dead,			/**< Left 4 Dead */
    74 	Engine_DarkMessiah,			/**< Dark Messiah Multiplayer (based on original engine) */
    75 	Engine_Left4Dead2 = 7,		/**< Left 4 Dead 2 */
    76 	Engine_AlienSwarm,			/**< Alien Swarm (and Alien Swarm SDK) */
    77 	Engine_BloodyGoodTime,		/**< Bloody Good Time */
    78 	Engine_EYE,					/**< E.Y.E Divine Cybermancy */
    79 	Engine_Portal2,				/**< Portal 2 */
    80 	Engine_CSGO,				/**< Counter-Strike: Global Offensive */
    81 	Engine_CSS,					/**< Counter-Strike: Source */
    82 	Engine_DOTA,				/**< Dota 2 */
    83 	Engine_HL2DM,				/**< Half-Life 2 Deathmatch */
    84 	Engine_DODS,				/**< Day of Defeat: Source */
    85 	Engine_TF2,					/**< Team Fortress 2 */
    86 	Engine_NuclearDawn,			/**< Nuclear Dawn */
    87 	Engine_SDK2013,				/**< Source SDK 2013 */
    88 	Engine_Blade,				/**< Blade Symphony */
    89 	Engine_Insurgency,			/**< Insurgency (2013 Retail version)*/
    90 	Engine_Contagion,			/**< Contagion */
    91 };
    92 
    93 #define INVALID_ENT_REFERENCE 0xFFFFFFFF
    94 
    95 /**
    96  * Logs a generic message to the HL2 logs.
    97  *
    98  * @param format		String format.
    99  * @param ...			Format arguments.
   100  * @noreturn
   101  */
   102 native LogToGame(const String:format[], any:...);
   103 
   104 /**
   105  * Sets the seed value for the global Half-Life 2 Random Stream.
   106  *
   107  * @param seed			Seed value.
   108  * @noreturn	
   109  */
   110 native SetRandomSeed(seed);
   111 
   112 /**
   113  * Returns a random floating point number from the Half-Life 2 Random Stream.
   114  *
   115  * @param fMin			Minimum random bound.
   116  * @param fMax			Maximum random bound.
   117  * @return				A random number between (inclusive) fMin and fMax.
   118  */
   119 native Float:GetRandomFloat(Float:fMin=0.0, Float:fMax=1.0);
   120 
   121 /**
   122  * Returns a random number from the Half-Life 2 Random Stream.
   123  *
   124  * @param nmin			Minimum random bound.
   125  * @param nmax			Maximum random bound.
   126  * @return				A random number between (inclusive) nmin and nmax.
   127  */
   128 native GetRandomInt(nmin, nmax);
   129 
   130 /**
   131  * Returns whether a map is valid or not.
   132  * 
   133  * @param map 			Map name, excluding .bsp extension.
   134  * @return				True if valid, false otherwise.
   135  */
   136 native bool:IsMapValid(const String:map[]);
   137 
   138 /**
   139  * Returns whether the server is dedicated.
   140  *
   141  * @return				True if dedicated, false otherwise.
   142  */
   143 native bool:IsDedicatedServer();
   144 
   145 /**
   146  * Returns a high-precision time value for profiling the engine.
   147  *
   148  * @return				A floating point time value.
   149  */
   150 native Float:GetEngineTime();
   151 
   152 /** 
   153  * Returns the game time based on the game tick.
   154  *
   155  * @return				Game tick time.
   156  */
   157 native Float:GetGameTime();
   158 
   159 /** 
   160  * Returns the game's internal tick count.
   161  *
   162  * @return				Game tick count.
   163  */
   164 native GetGameTickCount();
   165 
   166 /**
   167  * Returns the game description from the mod.
   168  *
   169  * @param buffer		Buffer to store the description.
   170  * @param maxlength		Maximum size of the buffer.
   171  * @param original		If true, retrieves the original game description,
   172  *						ignoring any potential hooks from plugins.
   173  * @return				Number of bytes written to the buffer (UTF-8 safe).
   174  */
   175 native GetGameDescription(String:buffer[], maxlength, bool:original=false);
   176 
   177 /**
   178  * Returns the name of the game's directory.
   179  *
   180  * @param buffer		Buffer to store the directory name.
   181  * @param maxlength		Maximum size of the buffer.
   182  *
   183  * return				Number of bytes written to the buffer (UTF-8 safe).
   184  */
   185 native GetGameFolderName(String:buffer[], maxlength);
   186 
   187 /**
   188  * Returns the current map name.
   189  *
   190  * @param buffer		Buffer to store map name.
   191  * @param maxlength		Maximum length of buffer.
   192  * @return				Number of bytes written (UTF-8 safe).
   193  */
   194 native GetCurrentMap(String:buffer[], maxlength);
   195 
   196 /**
   197  * Precaches a given model.
   198  *
   199  * @param model			Name of the model to precache.
   200  * @param preload		If preload is true the file will be precached before level startup.
   201  * @return				Returns the model index, 0 for error.
   202  */
   203 native PrecacheModel(const String:model[], bool:preload=false);
   204 
   205 /**
   206  * Precaches a given sentence file.
   207  *
   208  * @param file			Name of the sentence file to precache.
   209  * @param preload		If preload is true the file will be precached before level startup.
   210  * @return				Returns a sentence file index.
   211  */
   212 native PrecacheSentenceFile(const String:file[], bool:preload=false);
   213 
   214 /**
   215  * Precaches a given decal.
   216  *
   217  * @param decal			Name of the decal to precache.
   218  * @param preload		If preload is true the file will be precached before level startup.
   219  * @return				Returns a decal index.
   220  */
   221 native PrecacheDecal(const String:decal[], bool:preload=false);
   222 
   223 /**
   224  * Precaches a given generic file.
   225  *
   226  * @param generic		Name of the generic file to precache.
   227  * @param preload		If preload is true the file will be precached before level startup.
   228  * @return				Returns a generic file index.
   229  */
   230 native PrecacheGeneric(const String:generic[], bool:preload=false);
   231 
   232 /**
   233  * Returns if a given model is precached.
   234  *
   235  * @param model			Name of the model to check.
   236  * @return				True if precached, false otherwise.
   237  */
   238 native bool:IsModelPrecached(const String:model[]);
   239 
   240 /**
   241  * Returns if a given decal is precached.
   242  *
   243  * @param decal			Name of the decal to check.
   244  * @return				True if precached, false otherwise.
   245  */
   246 native bool:IsDecalPrecached(const String:decal[]);
   247 
   248 /**
   249  * Returns if a given generic file is precached.
   250  *
   251  * @param generic		Name of the generic file to check.
   252  * @return				True if precached, false otherwise.
   253  */
   254 native bool:IsGenericPrecached(const String:generic[]);
   255 
   256 /**
   257  * Precaches a given sound.
   258  *
   259  * @param sound			Name of the sound to precache.
   260  * @param preload		If preload is true the file will be precached before level startup.
   261  * @return				True if successfully precached, false otherwise.
   262  */
   263 native bool:PrecacheSound(const String:sound[], bool:preload=false);
   264 
   265 /**
   266  * Returns if a given sound is precached.
   267  *
   268  * @param sound			Name of the sound to check.
   269  * @return				True if precached, false otherwise.
   270  */
   271 native bool:IsSoundPrecached(const String:sound[]);
   272 
   273 /**
   274  * Creates different types of ingame messages.
   275  *
   276  * @param client		Index of the client.
   277  * @param kv			KeyValues handle to set the menu keys and options. (Check iserverplugin.h for more information).
   278  * @param type			Message type to display ingame.
   279  * @noreturn
   280  * @error				Invalid client index, or client not connected.
   281  */
   282 native CreateDialog(client, Handle:kv, DialogType:type);
   283 
   284 /**
   285  * Guesses the SDK version a mod was compiled against.  If nothing 
   286  * specific is known about the game, the engine version is used instead.
   287  *
   288  * The return values are guaranteed to increase chronologically (that is, 
   289  * a later release will have a higher value).
   290  *
   291  * @return				SOURCE_SDK version code.
   292  */
   293 #pragma deprecated See GetEngineVersion()
   294 native GuessSDKVersion();
   295 
   296 /**
   297  * Gets the engine version that the currently-loaded SM core was compiled against.
   298  *
   299  * The engine version values are not guaranteed to be in any particular order,
   300  * and should only be compared by (in)equality.
   301  *
   302  * @return				An EngineVersion value.
   303  */
   304 native EngineVersion:GetEngineVersion();
   305 
   306 /**
   307  * Prints a message to a specific client in the chat area.
   308  *
   309  * @param client		Client index.
   310  * @param format		Formatting rules.
   311  * @param ...			Variable number of format parameters.
   312  * @noreturn
   313  * @error				If the client is not connected an error will be thrown.
   314  */
   315 native PrintToChat(client, const String:format[], any:...);
   316 
   317 /**
   318  * Prints a message to all clients in the chat area.
   319  *
   320  * @param format		Formatting rules.
   321  * @param ...			Variable number of format parameters.
   322  * @noreturn
   323  */
   324 stock PrintToChatAll(const String:format[], any:...)
   325 {
   326 	decl String:buffer[192];
   327 	
   328 	for (new i = 1; i <= MaxClients; i++)
   329 	{
   330 		if (IsClientInGame(i))
   331 		{
   332 			SetGlobalTransTarget(i);
   333 			VFormat(buffer, sizeof(buffer), format, 2);
   334 			PrintToChat(i, "%s", buffer);
   335 		}
   336 	}
   337 }
   338 
   339 /**
   340  * Prints a message to a specific client in the center of the screen.
   341  *
   342  * @param client		Client index.
   343  * @param format		Formatting rules.
   344  * @param ...			Variable number of format parameters.
   345  * @noreturn
   346  * @error				If the client is not connected an error will be thrown.
   347  */
   348 native PrintCenterText(client, const String:format[], any:...);
   349 
   350 /**
   351  * Prints a message to all clients in the center of the screen.
   352  *
   353  * @param format		Formatting rules.
   354  * @param ...			Variable number of format parameters.
   355  * @noreturn
   356  */
   357 stock PrintCenterTextAll(const String:format[], any:...)
   358 {
   359 	decl String:buffer[192];
   360 
   361 	for (new i = 1; i <= MaxClients; i++)
   362 	{
   363 		if (IsClientInGame(i))
   364 		{
   365 			SetGlobalTransTarget(i);
   366 			VFormat(buffer, sizeof(buffer), format, 2);
   367 			PrintCenterText(i, "%s", buffer);
   368 		}
   369 	}
   370 }
   371 
   372 /**
   373  * Prints a message to a specific client with a hint box.
   374  *
   375  * @param client		Client index.
   376  * @param format		Formatting rules.
   377  * @param ...			Variable number of format parameters.
   378  * @noreturn
   379  * @error				If the client is not connected an error will be thrown.
   380  */
   381 native PrintHintText(client, const String:format[], any:...);
   382 
   383 /**
   384  * Prints a message to all clients with a hint box.
   385  *
   386  * @param format		Formatting rules.
   387  * @param ...			Variable number of format parameters.
   388  * @noreturn
   389  */
   390 stock PrintHintTextToAll(const String:format[], any:...)
   391 {
   392 	decl String:buffer[192];
   393 	
   394 	for (new i = 1; i <= MaxClients; i++)
   395 	{
   396 		if (IsClientInGame(i))
   397 		{
   398 			SetGlobalTransTarget(i);
   399 			VFormat(buffer, sizeof(buffer), format, 2);
   400 			PrintHintText(i, "%s", buffer);
   401 		}
   402 	}
   403 }
   404 
   405 /**
   406  * Shows a VGUI panel to a specific client.
   407  *
   408  * @param client		Client index.
   409  * @param name			Panel type name (Check viewport_panel_names.h to see a list of 
   410  *						some panel names).
   411  * @param Kv			KeyValues handle with all the data for the panel setup (Depends 
   412  *						on the panel type and may be unused).
   413  * @param show			True to show the panel, or false to remove it from the client screen.
   414  * @noreturn
   415  * @error				If the client is not connected an error will be thrown.
   416  */
   417 native ShowVGUIPanel(client, const String:name[], Handle:Kv=INVALID_HANDLE, bool:show=true);
   418 
   419 /**
   420  * Creates a HUD synchronization object.  This object is used to automatically assign and 
   421  * re-use channels for a set of messages.  
   422  *
   423  * The HUD has a hardcoded number of channels (usually 6) for displaying 
   424  * text.  You can use any channel for any area of the screen.  Text on 
   425  * different channels can overlap, but text on the same channel will 
   426  * erase the old text first.  This overlapping and overwriting gets problematic.
   427  *
   428  * A HUD synchronization object automatically selects channels for you based on 
   429  * the following heuristics:
   430  *  - If channel X was last used by the object, and hasn't been modified again, 
   431  *    channel X gets re-used.
   432  *  - Otherwise, a new channel is chosen based on the least-recently-used channel.
   433  *
   434  * This ensures that if you display text on a sync object, that the previous text 
   435  * displayed on it will always be cleared first.  This is because your new text 
   436  * will either overwrite the old text on the same channel, or because another 
   437  * channel has already erased your text.
   438  *
   439  * Note that messages can still overlap if they are on different synchronization 
   440  * objects, or they are displayed to manual channels.
   441  *
   442  * These are particularly useful for displaying repeating or refreshing HUD text, in 
   443  * addition to displaying multiple message sets in one area of the screen (for example, 
   444  * center-say messages that may pop up randomly that you don't want to overlap each 
   445  * other).
   446  *
   447  * @return				New HUD synchronization object.
   448  *						The Handle can be closed with CloseHandle().
   449  *						If HUD text is not supported on this mod, then 
   450  *						INVALID_HANDLE is returned.
   451  */
   452 native Handle:CreateHudSynchronizer();
   453 
   454 /**
   455  * Sets the HUD parameters for drawing text.  These parameters are stored 
   456  * globally, although nothing other than this function and SetHudTextParamsEx 
   457  * modify them.
   458  *
   459  * You must call this function before drawing text.  If you are drawing 
   460  * text to multiple clients, you can set the parameters once, since 
   461  * they won't be modified.  However, as soon as you pass control back 
   462  * to other plugins, you must reset the parameters next time you draw.
   463  *
   464  * @param x				x coordinate, from 0 to 1.  -1.0 is the center.
   465  * @param y				y coordinate, from 0 to 1.  -1.0 is the center.
   466  * @param holdTime		Number of seconds to hold the text.
   467  * @param r				Red color value.
   468  * @param g				Green color value.
   469  * @param b				Blue color value.
   470  * @param a				Alpha transparency value.
   471  * @param effect 		0/1 causes the text to fade in and fade out.
   472  *						2 causes the text to flash[?].
   473  * @param fxTime		Duration of chosen effect (may not apply to all effects).
   474  * @param fadeIn		Number of seconds to spend fading in.
   475  * @param fadeOut		Number of seconds to spend fading out.
   476  * @noreturn
   477  */
   478 native SetHudTextParams(Float:x, Float:y, Float:holdTime, r, g, b, a, effect = 0,
   479 						Float:fxTime=6.0, Float:fadeIn=0.1, Float:fadeOut=0.2);
   480 						
   481 /**
   482  * Sets the HUD parameters for drawing text.  These parameters are stored 
   483  * globally, although nothing other than this function and SetHudTextParams
   484  * modify them.
   485  *
   486  * This is the same as SetHudTextParams(), except it lets you set the alternate 
   487  * color for when effects require it.  
   488  *
   489  * @param x				x coordinate, from 0 to 1.  -1.0 is the center.
   490  * @param y				y coordinate, from 0 to 1.  -1.0 is the center.
   491  * @param holdTime		Number of seconds to hold the text.
   492  * @param color1		First color set, array values being [red, green, blue, alpha]
   493  * @param color2		Second color set, array values being [red, green, blue, alpha]
   494  * @param effect 		0/1 causes the text to fade in and fade out.
   495  *						2 causes the text to flash[?].
   496  * @param fxTime		Duration of chosen effect (may not apply to all effects).
   497  * @param fadeIn		Number of seconds to spend fading in.
   498  * @param fadeOut		Number of seconds to spend fading out.
   499  * @noreturn
   500  */
   501 native SetHudTextParamsEx(Float:x, Float:y, Float:holdTime, color1[4], 
   502 						  color2[4]={255,255,255,0}, effect = 0, Float:fxTime=6.0, 
   503 						  Float:fadeIn=0.1, Float:fadeOut=0.2);
   504 
   505 /**
   506  * Shows a synchronized HUD message to a client.  
   507  *
   508  * As of this writing, only TF, HL2MP, and SourceForts support HUD Text.
   509  *
   510  * @param client		Client index to send the message to.
   511  * @param sync			Synchronization object.
   512  * @param message		Message text or formatting rules.
   513  * @param ...			Message formatting parameters.
   514  * @return				-1 on failure, anything else on success.
   515  *						This function fails if the mod does not support it.
   516  * @error				Client not in-game, or sync object not valid.
   517  */
   518 native ShowSyncHudText(client, Handle:sync, const String:message[], any:...);
   519 
   520 /**
   521  * Clears the text on a synchronized HUD channel. 
   522  *
   523  * This is not the same as sending "" because it guarantees that it won't 
   524  * overwrite text on another channel.  For example, consider the scenario: 
   525  *
   526  * 1. Your synchronized message goes to channel 3.
   527  * 2. Someone else's non-synchronized message goes to channel 3.
   528  *
   529  * If you were to simply send "" on your synchronized message, 
   530  * then someone else's text could be overwritten.
   531  *
   532  * @param client		Client index to send the message to.
   533  * @param sync			Synchronization object.
   534  * @noreturn
   535  * @error				Client not in-game, or sync object not valid.
   536  */
   537 native ClearSyncHud(client, Handle:sync);
   538 
   539 /**
   540  * Shows a HUD message to a client on the given channel.
   541  *
   542  * As of this writing, only TF, HL2MP, and SourceForts support HUD Text.
   543  * 
   544  * @param client		Client index to send the message to.
   545  * @param channel		A channel number.
   546  *						If -1, then a channel will automatically be selected 
   547  *						based on the least-recently-used channel.  If the 
   548  *						channel is any other number, it will be modulo'd with 
   549  *						the channel count to get a final channel number.
   550  * @param message		Message text or formatting rules.
   551  * @param ...			Message formatting parameters.
   552  * @return				-1 on failure (lack of mod support).
   553  *						Any other return value is the channel number that was 
   554  *						used to render the text.
   555  */
   556 native ShowHudText(client, channel, const String:message[], any:...);
   557 
   558 /**
   559  * Shows a MOTD panel to a specific client.
   560  *
   561  * @param client		Client index.
   562  * @param title			Title of the panel (printed on the top border of the window).
   563  * @param msg			Contents of the panel, it can be treated as an url, filename or plain text
   564  *				 		depending on the type parameter (WARNING: msg has to be 192 bytes maximum!)
   565  * @param type			Determines the way to treat the message body of the panel.
   566  * @noreturn
   567  * @error				If the client is not connected an error will be thrown.
   568  */
   569 stock ShowMOTDPanel(client, const String:title[], const String:msg[], type=MOTDPANEL_TYPE_INDEX)
   570 {
   571 	decl String:num[3];
   572 	new Handle:Kv = CreateKeyValues("data");
   573 	IntToString(type, num, sizeof(num));
   574 
   575 	KvSetString(Kv, "title", title);
   576 	KvSetString(Kv, "type", num);
   577 	KvSetString(Kv, "msg", msg);
   578 	ShowVGUIPanel(client, "info", Kv);
   579 	CloseHandle(Kv);
   580 }
   581 
   582 /**
   583  * Displays a panel asking the client to connect to a specified IP.
   584  *
   585  * @param client		Client index.
   586  * @param time			Duration to hold the panel on the client's screen.
   587  * @param ip			Destination IP.
   588  * @param password		Password to connect to the destination IP. The client will be able to see this.
   589  * @noreturn
   590  */
   591 stock DisplayAskConnectBox(client, Float:time, const String:ip[], const String:password[] = "")
   592 {
   593 	decl String:destination[288];
   594 	FormatEx(destination, sizeof(destination), "%s/%s", ip, password);
   595 	new Handle:Kv = CreateKeyValues("data");
   596 	KvSetFloat(Kv, "time", time);
   597 	KvSetString(Kv, "title", destination);
   598 	CreateDialog(client, Kv, DialogType_AskConnect);
   599 	CloseHandle(Kv);
   600 }
   601 
   602 /**
   603  * Converts an entity index into a serial encoded entity reference.
   604  *
   605  * @param entity		Entity index.
   606  * @return				Entity reference.
   607  */
   608 native EntIndexToEntRef(entity);
   609 
   610 /**
   611  * Retrieves the entity index from a reference.
   612  *
   613  * @param ref			Entity reference.
   614  * @return				Entity index.
   615  */
   616 native EntRefToEntIndex(ref);
   617 
   618 /**
   619  * Converts a reference into a backwards compatible version.
   620  *
   621  * @param ref			Entity reference.
   622  * @return				Bcompat reference.
   623  */
   624 native MakeCompatEntRef(ref);
   625