Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. public plugin_init() {
  5. register_plugin("RateMap", "1.0", "NiK") // small edit by DecaK
  6. register_menucmd(register_menuid("RateMap_menu"),1023,"RateMap");
  7.  
  8. }
  9.  
  10. public client_connect(id) {
  11.  
  12. set_task(10.0, "RateMapMenu", id)
  13. set_task(20.0, "UgasiRateMapMenu", id)
  14. }
  15.  
  16. public RateMapMenu(id) {
  17. new mapname [32]
  18. get_mapname(mapname,31)
  19. static MenuBody[128];
  20. {
  21. new len = format(MenuBody,127,"RateMap:Ocenite mapu: %s", mapname);
  22. len += format(MenuBody[len],127-len,"^n1. Dobra");
  23. len += format(MenuBody[len],127-len,"^n2. Onako");
  24. len += format(MenuBody[len],127-len,"^n3. Losa");
  25. }
  26. new keys = MENU_KEY_1|MENU_KEY_2;
  27. show_menu(id,keys,MenuBody,-1,"RateMap_menu");
  28. }
  29.  
  30. public RateMap(id,key)
  31. {
  32. switch(key)
  33. {
  34. case 0:
  35. {
  36. new mapname [32]
  37. new name[32]
  38. new logmsg[97]
  39. get_mapname(mapname,31)
  40. get_user_name(id, name, 31)
  41. format(logmsg, 96, "%s (Mapa: %s) je glasao ^"Dobra^".", name, mapname)
  42. write_file("ratemap.txt", logmsg)
  43. client_print(id, print_chat, "RateMap by NiK")
  44. }
  45. case 1:
  46. {
  47. new mapname [32]
  48. new name[32]
  49. new logmsg[97]
  50. get_mapname(mapname,31)
  51. get_user_name(id, name, 31)
  52. format(logmsg, 96, "%s (Mapa: %s) je glasao ^"Onako^".", name, mapname)
  53. write_file("ratemap.txt", logmsg)
  54. client_print(id, print_chat, "RateMap by NiK")
  55. }
  56. case 2:
  57. {
  58. new mapname [32]
  59. new name[32]
  60. new logmsg[97]
  61. get_mapname(mapname,31)
  62. get_user_name(id, name, 31)
  63. format(logmsg, 96, "%s (Mapa: %s) je glasao ^"Losa^".", name, mapname)
  64. write_file("ratemap.txt", logmsg)
  65. client_print(id, print_chat, "RateMap by NiK")
  66. }
  67. }
  68. }
  69.  
  70. public UgasiRateMapMenu(id) {
  71. menu_destroy(id);
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement