Advertisement
iFenomenal

respawn furien

Apr 9th, 2020
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <hamsandwich>
  4.  
  5. #define PLUGIN "Respawn Status"
  6. #define VERSION "1.0"
  7.  
  8. new g_bStatus;
  9. public plugin_init()
  10. {
  11. register_plugin(PLUGIN, VERSION, "ma-ta")
  12.  
  13. RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled", 0);
  14.  
  15. register_clcmd("say /respawn","cmdSayRespawn")
  16. register_clcmd("say_team /respawn","cmdSayRespawn")
  17. }
  18. public cmdSayRespawn(id)
  19. {
  20. if(!(get_user_flags(id) & ADMIN_IMMUNITY))
  21. {
  22. client_print(id, print_chat, "Nu ai acces la comanda !");
  23. return PLUGIN_HANDLED;
  24. }
  25. new szText[192];
  26. new menu = menu_create("Change RESPAWN status", "handlerMenu");
  27.  
  28. switch(g_bStatus)
  29. {
  30. case true: formatex(szText, 191, "RESPAWN - yON")
  31. case false: formatex(szText, 191, "RESPAWN - dOFF")
  32. }
  33. menu_additem(menu, szText, "1", 0)
  34.  
  35. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  36. menu_display(id, menu, 0);
  37.  
  38. return PLUGIN_HANDLED;
  39. }
  40. public handlerMenu(id, menu, item)
  41. {
  42. if( item == MENU_EXIT )
  43. {
  44. menu_destroy(menu);
  45. return PLUGIN_HANDLED;
  46. }
  47. new data[6], iName[64];
  48. new access, callback;
  49. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  50. new key = str_to_num(data);
  51.  
  52. switch(key)
  53. {
  54. case 1:
  55. {
  56. switch(g_bStatus)
  57. {
  58. case true:
  59. {
  60. g_bStatus = false;
  61. client_print(id, print_chat, "Respawnul a fost dezactivat !");
  62. }
  63. case false:
  64. {
  65. g_bStatus = true;
  66. client_print(id, print_chat, "Respawnul a fost activat !");
  67. }
  68. }
  69. cmdSayRespawn(id);
  70. }
  71. }
  72. menu_destroy(menu);
  73. return PLUGIN_HANDLED;
  74. }
  75. public Ham_PlayerKilled(victim, attacker, shouldgib)
  76. {
  77. if(g_bStatus)
  78. set_task(1.0,"Respawn_Player", victim);
  79. }
  80. public Respawn_Player(id)
  81. {
  82. ExecuteHam(Ham_CS_RoundRespawn, id);
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement