plugins/include/halflife.inc
changeset 1413 8bf5f32608bc
parent 1330 ab94316bb52b
child 1837 652038bb27e6
     1.1 --- a/plugins/include/halflife.inc	Wed Sep 12 22:46:00 2007 +0000
     1.2 +++ b/plugins/include/halflife.inc	Wed Sep 12 23:37:00 2007 +0000
     1.3 @@ -45,7 +45,8 @@
     1.4  	DialogType_Msg = 0,		/**< just an on screen message */
     1.5  	DialogType_Menu, 		/**< an options menu */
     1.6  	DialogType_Text, 		/**< a richtext dialog */
     1.7 -	DialogType_Entry 		/**< an entry box */
     1.8 +	DialogType_Entry, 		/**< an entry box */
     1.9 +	DialogType_AskConnect		/**< ask the client to connect to a specified IP */
    1.10  };
    1.11  
    1.12  /**
    1.13 @@ -367,3 +368,20 @@
    1.14  	ShowVGUIPanel(client, "info", Kv);
    1.15  	CloseHandle(Kv);
    1.16  }
    1.17 +
    1.18 +/**
    1.19 + * Displays a panel asking the client to connect to a specified IP.
    1.20 + *
    1.21 + * @param client		Client index.
    1.22 + * @param time			Duration to hold the panel on the client's screen.
    1.23 + * @param ip			Destionation IP.
    1.24 + * @noreturn
    1.25 + */
    1.26 +stock DisplayAskConnectBox(client, Float:time, const String:ip[])
    1.27 +{
    1.28 +	new Handle:Kv = CreateKeyValues("data");
    1.29 +	KvSetFloat(Kv, "time", time);
    1.30 +	KvSetString(Kv, "title", ip);
    1.31 +	CreateDialog(client, Kv, DialogType_AskConnect);
    1.32 +	CloseHandle(Kv);
    1.33 +}