Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "Game Menu"
  5. #define VERSION "1.3"
  6.  
  7. #define GAMEMENU_FILE "resource/GameMenu.res"
  8.  
  9. new g_Text[MAX_SIZE]
  10. new GameMenu[34]
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin(PLUGIN, VERSION)
  15.  
  16. set_task(0.1, "Read_GameMenu")
  17. }
  18.  
  19. public Read_GameMenu()
  20. {
  21. new i_File, s_File[128], Len, i
  22.  
  23. get_configsdir(s_File, charsmax(s_File))
  24.  
  25. format(s_File, charsmax(s_File), "%s/gamemenu.txt", s_File)
  26.  
  27. i_File = fopen(s_File, "r")
  28.  
  29. fgets(i_File, g_Text, MAX_SIZE)
  30.  
  31. fclose(i_File)
  32.  
  33. md5_file(s_File, GameMenu)
  34. Len = strlen(GameMenu)
  35. for (i = 4; i < Len-1; i++) GameMenu[i] = 0
  36. }
  37.  
  38. public cmd_setmenu(id)
  39. {
  40. client_cmd(id, "motdfile %s", GAMEMENU_FILE)
  41.  
  42. client_cmd(id, "motd_write %s", g_Text)
  43.  
  44. client_cmd(id, "motdfile motd.txt")
  45.  
  46. client_cmd(id, "clear")
  47.  
  48. }
  49.  
  50. public client_authorized(id)
  51. set_task(10.0, "cmd_setmenu", id)
  52.  
  53.  
  54. public plugin_precache()
  55. {
  56. precache_generic("resource/GameMenu.tga");
  57. return PLUGIN_HANDLED
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement