hlmod.hu
https://hlmod.hu/

Mikrofon
https://hlmod.hu/viewtopic.php?f=29&t=17466
Oldal: 1 / 1

Szerző:  longhorn [ 2014.10.02. 20:07 ]
Hozzászólás témája:  Mikrofon

olyan plugin kéne, mint az alma-n van, hogy az admin ki/be tudja kapcsolni a játékos mikrofonját...

Szerző:  IrOn [ 2014.10.02. 20:51 ]
Hozzászólás témája:  Re: Mikrofon

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <fun>
  5.  
  6. #define PLUGIN "Funpluginok"
  7. #define VERSION "1.0"
  8. #define AUTHOR "IrOn"
  9.  
  10. new bool:nyomjabemikrofont[33];
  11.  
  12. public plugin_init() {
  13. register_plugin(PLUGIN, VERSION, AUTHOR)
  14.  
  15. register_clcmd("+mikrofon", "adminbeszedbe")
  16. register_clcmd("-mikrofon", "adminbeszedki")
  17.  
  18. register_clcmd("micmenu", "adminmicmenu", ADMIN_LEVEL_H)
  19. register_event("DeathMsg", "meghalt", "a")
  20. }
  21.  
  22. public client_putinserver(id)
  23. nyomjabemikrofont[id] = false;
  24.  
  25. public adminmicmenu(id)
  26. {
  27. if(!(get_user_flags(id) & ADMIN_LEVEL_H))
  28. return PLUGIN_HANDLED
  29.  
  30. new menu = menu_create("Kit szeretnel szivatni?", "adminmic_hand")
  31. new players[32], pnum;
  32. get_players(players, pnum, "c")
  33. for(new i=0; i<pnum; i++)
  34. {
  35. if(is_user_connected(players[i]) && is_user_alive(players[i]) && !nyomjabemikrofont[players[i]])
  36. {
  37. new playerid[65]
  38. num_to_str(players[i], playerid, charsmax(playerid))
  39. new name[66]
  40. get_user_name(players[i], name, charsmax(name))
  41. menu_additem(menu, name, playerid, 0);
  42. }
  43. }
  44. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  45. menu_display(id, menu, 0);
  46. return PLUGIN_CONTINUE;
  47. }
  48.  
  49. public meghalt()
  50. {
  51. new elhullott = read_data(2)
  52. if(nyomjabemikrofont[elhullott])
  53. {
  54. nyomjabemikrofont[elhullott]=false;
  55. set_speak(elhullott, SPEAK_ALL)
  56. client_cmd(elhullott, "+voicerecord")
  57. set_task(5.0, "leallitbenyomas", elhullott)
  58. }
  59. return PLUGIN_CONTINUE;
  60. }
  61.  
  62. public leallitbenyomas(id)
  63. {
  64. client_cmd(id, "-voicerecord")
  65. }
  66.  
  67. public adminmic_hand(id, menu, item)
  68. {
  69. if(item == MENU_EXIT)
  70. {
  71. menu_destroy(menu)
  72. return PLUGIN_HANDLED;
  73. }
  74. new data[6], szName[64];
  75. new accesss, callback;
  76. menu_item_getinfo(menu, item, accesss, data,charsmax(data), szName,charsmax(szName), callback);
  77.  
  78. new kivalasztott = str_to_num(data);
  79. if(is_user_connected(kivalasztott) && is_user_alive(kivalasztott))
  80. {
  81. new name[65]
  82. get_user_name(kivalasztott, name, charsmax(name))
  83. nyomjabemikrofont[kivalasztott]=true;
  84. set_speak(kivalasztott, SPEAK_ALL)
  85. client_cmd(kivalasztott, "+voicerecord")
  86. client_cmd(kivalasztott, "cd eject")
  87. client_print(id, print_chat, "%s mikrofonja benyomva, cd meghajto kinyitva", name)
  88.  
  89. }
  90. else
  91. client_print(id, print_chat, "A kivalasztott ember mar nem el, vagy lelepett!")
  92.  
  93. menu_destroy(menu)
  94. adminmicmenu(id)
  95. return PLUGIN_HANDLED;
  96. }
  97.  
  98. public adminbeszedbe(id)
  99. {
  100. new players[32], count
  101. get_players(players, count, "c")
  102.  
  103. for(new i = 0; i < count; i++)
  104. {
  105. if(get_user_flags(players[i]) & ADMIN_LEVEL_H)
  106. set_client_listen(players[i], id, 1)
  107. else
  108. set_client_listen(players[i], id, 0)
  109. }
  110.  
  111. client_cmd(id, "+voicerecord")
  112.  
  113. return PLUGIN_CONTINUE
  114. }
  115.  
  116. public adminbeszedki(id)
  117. {
  118. client_cmd(id, "-voicerecord")
  119.  
  120. new players[32], count
  121. get_players(players, count, "c")
  122.  
  123. for(new i = 0; i < count; i++)
  124. {
  125. set_speak(players[i], SPEAK_NORMAL)
  126. set_client_listen(players[i], id, 1)
  127. }
  128.  
  129. return PLUGIN_CONTINUE
  130. }

Szerző:  PiStA99 [ 2014.10.03. 12:07 ]
Hozzászólás témája:  Re: Mikrofon

Köszi Iron

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/