hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.18. 00:48



Jelenlévő felhasználók

Jelenleg 359 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 357 vendég

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása Hozzászólás a témához  [13 hozzászólás ]  OldalElőző12
Szerző Üzenet
 Hozzászólás témája: Re: Vágd el a megfelelő vezetéket!
HozzászólásElküldve:2015.10.24. 23:07 
Offline
Tiszteletbeli
Avatar

Csatlakozott:2015.03.11. 20:11
Hozzászólások:915
Megköszönt másnak: 52 alkalommal
Megköszönték neki: 317 alkalommal
Tényleg hibás volt, de fixálva, itt a friss forráskód:
SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X script.
  2. *
  3. * Cut The Right Wire
  4. *
  5. * by The Specialist
  6. *
  7. * Idea : TinLab
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at
  12. * your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software Foundation,
  21. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. *
  23. * In addition, as a special exception, the author gives permission to
  24. * link the code of this program with the Half-Life Game Engine ("HL
  25. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  26. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  27. * respects for all of the code used other than the HL Engine and MODs
  28. * from Valve. If you modify this file, you may extend this exception
  29. * to your version of the file, but you are not obligated to do so. If
  30. * you do not wish to do so, delete this exception statement from your
  31. * version.
  32. */
  33.  
  34. #include <amxmodx>
  35. #include <fakemeta>
  36.  
  37. #define TE_EXPLOSION 3
  38.  
  39. new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2 ;
  40. new g_Switch;
  41. new i;
  42. new PlayerDefused[33];
  43. new Sprite;
  44. new Float: Location[3];
  45. new wire;
  46. new g_AllTalk;
  47.  
  48. public plugin_init()
  49. {
  50. register_plugin("Cut The Right Wire","0.4","The Specialist");
  51. g_Switch = register_cvar("ctrw_switch","1");
  52. g_AllTalk = register_cvar("ctrw_alltalk","1");
  53. register_dictionary("right_wire.txt");
  54. register_menucmd(register_menuid("menu_show"),1023,"menu_choose");
  55. register_event("ResetHUD","wire_call","be");
  56. register_logevent("bomb_defuse_no_kit", 3, "2=Begin_Bomb_Defuse_Without_Kit");
  57. register_logevent("bomb_defuse_no_kit", 3, "2=Begin_Bomb_Defuse_With_Kit");
  58. register_forward(FM_PlayerPreThink,"block_buttons");
  59. }
  60. // detect defusing
  61. public bomb_defuse_no_kit()
  62. {
  63. new id = get_loguser_index();
  64.  
  65. if(get_pcvar_num(g_Switch)==0 || PlayerDefused[id] > 0 || is_user_bot(id)==1)
  66. {
  67. return PLUGIN_HANDLED;
  68. }else{
  69. new menu[192];
  70. format(menu,191,"%L",id,"CHOOSE");
  71. show_menu(id,keys,menu,-1,"menu_show");
  72. ++PlayerDefused[id];
  73. all_talk();
  74. ++i;
  75. return 0;
  76. }
  77. return 0;
  78. }
  79. // reset hud event
  80. public wire_call(id)
  81. {
  82. PlayerDefused[id] = 0;
  83. wire = random_num(0,1);
  84. }
  85. // remove use button and show menu
  86. public menu_choose(id,key)
  87. {
  88. switch(key)
  89. {
  90. case 0 :
  91. {
  92. if( wire == 0 )
  93. {
  94. --i;
  95. return PLUGIN_HANDLED;
  96. }else{
  97. bomb_explosion(id);
  98. PlayerDefused[id] = 0;
  99. return 1
  100. }
  101. }
  102. case 1:
  103. {
  104. if( wire == 1)
  105. {
  106. --i;
  107. return PLUGIN_HANDLED;
  108. }else{
  109. bomb_explosion(id);
  110. PlayerDefused[id] = 0;
  111. return 1
  112. }
  113. }
  114. }
  115. return PLUGIN_HANDLED;
  116. }
  117. // block the users use button
  118. public block_buttons(id)
  119. {
  120. if( i == 0 )
  121. {
  122. return 1;
  123. }else{
  124. set_pev( id, pev_button, pev(id,pev_button) & ~IN_USE);
  125. }
  126. return 1;
  127. }
  128. //bomb explosion
  129. public bomb_explosion(id)
  130. {
  131. pev(id, pev_origin,Location);
  132. message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  133. write_byte(TE_EXPLOSION);
  134. engfunc(EngFunc_WriteCoord,Location[0]);
  135. engfunc(EngFunc_WriteCoord,Location[1]);
  136. engfunc(EngFunc_WriteCoord,Location[2]);
  137. write_short(Sprite);
  138. write_byte(255);
  139. write_byte(0);
  140. write_byte(0);
  141. message_end();
  142. user_silentkill(id);
  143. PlayerDefused[id] = 0;
  144. i = 0;
  145. return 1;
  146. }
  147. // turn all talk on
  148. public all_talk()
  149. {
  150. if(get_pcvar_num(g_AllTalk)==0)
  151. {
  152. return PLUGIN_HANDLED;
  153. }else{
  154. set_cvar_string("sv_alltalk","1");
  155. }
  156. return PLUGIN_HANDLED;
  157. }
  158. // function to get index from log events
  159. public get_loguser_index()
  160. {
  161. new loguser[80], name[32];
  162. read_logargv(0, loguser, 79);
  163. parse_loguser(loguser, name, 31);
  164. return get_user_index(name);
  165. }
  166. //precache sprites for exloasion
  167. public plugin_precache()
  168. {
  169. Sprite = precache_model("sprites/zerogxplode.spr");
  170. }
  171.  


Kép:
Kép

_________________
viewtopic.php?f=101&t=25611#p184899
viewtopic.php?f=114&t=29544&p=209471#p209431


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Vágd el a megfelelő vezetéket!
HozzászólásElküldve:2015.10.25. 00:54 
Offline
Tud valamit
Avatar

Csatlakozott:2013.10.02. 16:50
Hozzászólások:116
Megköszönt másnak: 5 alkalommal
Megköszönték neki: 78 alkalommal
Ne hozzászólásba....
Frissítsd a leírásod


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Vágd el a megfelelő vezetéket!
HozzászólásElküldve:2015.10.25. 01:01 
Offline
Tiszteletbeli
Avatar

Csatlakozott:2014.09.08. 22:21
Hozzászólások:3014
Megköszönt másnak: 96 alkalommal
Megköszönték neki: 555 alkalommal
Nem lehet elfogadott plugint módosítani :)

_________________
GitHub - mforce


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [13 hozzászólás ]  OldalElőző12


Ki van itt

Jelenlévő fórumozók: Bing [Bot] valamint 4 vendég


Nem nyithatsz témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole