HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Houndeye Zombie v0.4
  2. By Morte
  3.  
  4. -. Description: Blast player and make it fly.
  5.  
  6. -. Cvars: zp_houndeye_timeblast 2.5 (Time to Blast)
  7. zp_houndeye_radius 150.0 (Blast Radius)
  8. zp_houndeye_infect_blast 0 (Blast infect players)
  9. zp_houndeye_damage 0 (Blast Damage)
  10. zp_houndeye_damage_amount 25 (Blast Damage Amount)
  11.  
  12.  
  13. -. Changelog:
  14. # 0.1 - Plugin Release
  15. # 0.2 - Added 2 cvar's: 1) To activate the blast damage
  16. 2) To select the amount of the damage
  17. # 0.3 - Now you can't use blast hability if you are nemesis.
  18. # 0.4 - Fixed cvar "zp_houndeye_damage_amount".
  19. -. Credits:
  20. # shinoda - Help me with how to make players fly.
  21. # MeRcyLeZZ - For his Zombie Plague ^.^
  22. # frk_14 - For the model.
  23.  
  24. */
  25.  
  26. #include <amxmodx>
  27. #include <hamsandwich>
  28. #include <fakemeta>
  29. #include <xs>
  30. #include <engine>
  31. #include <zombieplague>
  32.  
  33. /*================================================================================
  34.  [Plugin Customization]
  35. =================================================================================*/
  36.  
  37. new const zclass_name[] = { "Vadaszkutyaszemu Zombie" }
  38. new const zclass_info[] = { "Hanghullam ero (Nyomj E betut)" }
  39. new const zclass_model[] = { "houndeye" }
  40. new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
  41. const zclass_health = 1000
  42. const zclass_speed = 200
  43. const Float:zclass_gravity = 0.6
  44. const Float:zclass_knockback = 0.6
  45.  
  46. new const beam_cylinder[] = "sprites/white.spr"
  47.  
  48. new const houndeye_attack[][] = { "houndeye/he_attack1.wav", "houndeye/he_attack3.wav" }
  49. new const houndeye_blast[][] = { "houndeye/he_blast1.wav", "houndeye/he_blast3.wav" }
  50.  
  51. /*================================================================================
  52.  [End Customization]
  53. =================================================================================*/
  54.  
  55. #define is_player(%0) (1 <= %0 <= giMaxplayers)
  56. #define TASK_BARTIME 16000
  57.  
  58. // Zombie vars
  59. new gMsgBarTime, gMsgDeathMsg, gSprBeam, gHoundEye, giMaxplayers, cvar_timeblast, cvar_radius, cvar_blast_infect,
  60. cvar_damage, cvar_damage_amount
  61.  
  62. public plugin_init()
  63. {
  64. register_plugin("Houndeye Zombie", "0.4", "Morte")
  65.  
  66. cvar_timeblast = register_cvar("zp_houndeye_timeblast", "2.5")
  67. cvar_radius = register_cvar("zp_houndeye_radius", "150.0")
  68. cvar_blast_infect = register_cvar("zp_houndeye_infect", "0")
  69. cvar_damage = register_cvar("zp_houndeye_damage", "0")
  70. cvar_damage_amount = register_cvar("zp_houndeye_damage_amount", "25")
  71.  
  72. register_forward( FM_CmdStart, "CmdStart")
  73.  
  74. giMaxplayers = get_maxplayers()
  75. gMsgBarTime = get_user_msgid("BarTime")
  76. gMsgDeathMsg = get_user_msgid("DeathMsg")
  77. }
  78.  
  79. public plugin_precache()
  80. {
  81. gHoundEye = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
  82. gSprBeam = precache_model(beam_cylinder)
  83.  
  84. for (new i = 0; i < sizeof houndeye_attack; i++)
  85. engfunc(EngFunc_PrecacheSound, houndeye_attack[i])
  86. for (new i = 0; i < sizeof houndeye_blast; i++)
  87. engfunc(EngFunc_PrecacheSound, houndeye_blast[i])
  88. }
  89.  
  90. public CmdStart(id)
  91. {
  92. if(!is_user_alive(id))
  93. return;
  94.  
  95. static iButton; iButton = pev(id, pev_button)
  96. static iOldButton; iOldButton = pev(id, pev_oldbuttons)
  97.  
  98. if(zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == gHoundEye) && !zp_get_user_nemesis(id))
  99. {
  100. if( ( iButton & IN_USE ) && !( iOldButton & IN_USE ) )
  101. {
  102. if(!is_user_alive(id))
  103. return;
  104.  
  105. message_begin(MSG_ONE, gMsgBarTime, _, id)
  106. write_byte(get_pcvar_num(cvar_timeblast))
  107. write_byte(0)
  108. message_end()
  109.  
  110. emit_sound(id, CHAN_VOICE, houndeye_attack[random_num(0, sizeof houndeye_attack - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
  111.  
  112. set_task(get_pcvar_float(cvar_timeblast), "blast_players", id+TASK_BARTIME)
  113. }
  114.  
  115. if( iOldButton & IN_USE && !( iButton & IN_USE ) )
  116. set_task(0.1, "blast_stop", id)
  117. }
  118. }
  119.  
  120. public blast_stop(id)
  121. {
  122. message_begin(MSG_ONE, gMsgBarTime, _, id)
  123. write_byte(0)
  124. write_byte(0)
  125. message_end()
  126.  
  127. remove_task(id+TASK_BARTIME)
  128. }
  129.  
  130. public blast_players(id)
  131. {
  132. id -= TASK_BARTIME
  133.  
  134. new Float: iOrigin[3]
  135. pev(id, pev_origin, iOrigin)
  136.  
  137. emit_sound(id, CHAN_VOICE, houndeye_blast[random_num(0, sizeof houndeye_blast - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
  138.  
  139. engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, iOrigin, 0)
  140. write_byte(TE_BEAMCYLINDER)
  141. engfunc(EngFunc_WriteCoord, iOrigin[0])
  142. engfunc(EngFunc_WriteCoord, iOrigin[1])
  143. engfunc(EngFunc_WriteCoord, iOrigin[2])
  144. engfunc(EngFunc_WriteCoord, iOrigin[0])
  145. engfunc(EngFunc_WriteCoord, iOrigin[1])
  146. engfunc(EngFunc_WriteCoord, iOrigin[2]+385.0)
  147. write_short(gSprBeam)
  148. write_byte(0)
  149. write_byte(0)
  150. write_byte(4)
  151. write_byte(60)
  152. write_byte(0)
  153. write_byte(255)
  154. write_byte(255)
  155. write_byte(255)
  156. write_byte(200)
  157. write_byte(0)
  158. message_end()
  159.  
  160. static Ent, Float: originF[3]
  161.  
  162. while( (Ent = engfunc(EngFunc_FindEntityInSphere, Ent, iOrigin, get_pcvar_float(cvar_radius))) )
  163. {
  164. if( is_player(Ent) && Ent != id )
  165. {
  166. if(zp_get_user_zombie(Ent) || zp_get_user_zombie(Ent))
  167. return PLUGIN_CONTINUE;
  168.  
  169. if(get_pcvar_num(cvar_blast_infect))
  170. {
  171. zp_infect_user(Ent, 1)
  172.  
  173. SendDeathMsg(id, Ent)
  174. }
  175.  
  176. if(get_pcvar_num(cvar_damage))
  177. {
  178. if(zp_get_user_survivor(Ent))
  179. return PLUGIN_CONTINUE;
  180.  
  181. fm_set_user_health(Ent, pev(Ent, pev_health) - get_pcvar_num(cvar_damage_amount))
  182. }
  183.  
  184. pev(Ent, pev_origin, originF)
  185.  
  186. originF[0] = (originF[0] - iOrigin[0]) * 10.0
  187. originF[1] = (originF[1] - iOrigin[1]) * 10.0
  188. originF[2] = (originF[2] - iOrigin[2]) + 500.0
  189.  
  190. set_pev(Ent, pev_velocity, originF)
  191. }
  192. }
  193.  
  194. return PLUGIN_HANDLED;
  195. }
  196.  
  197. SendDeathMsg(attacker, victim)
  198. {
  199. message_begin(MSG_BROADCAST, gMsgDeathMsg)
  200. write_byte(attacker)
  201. write_byte(victim)
  202. write_byte(1)
  203. write_string("infection")
  204. message_end()
  205. }
  206.  
  207. /*================================================================================
  208.  [Stocks]
  209. =================================================================================*/
  210.  
  211. stock print_chatColor(const id,const input[], any:...)
  212. {
  213. new msg[191], players[32], count = 1;
  214. vformat(msg,190,input,3);
  215. replace_all(msg,190,"!g","^4");// green
  216. replace_all(msg,190,"!n","^1");// normal
  217. replace_all(msg,190,"!t","^3");// team
  218.  
  219. if (id) players[0] = id; else get_players(players,count,"ch");
  220. for (new i=0;i<count;i++)
  221. if (is_user_connected(players[i]))
  222. {
  223. message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
  224. write_byte(players[i]);
  225. write_string(msg);
  226. message_end();
  227. }
  228. }
  229.  
  230. stock fm_set_user_health(id, health)
  231. {
  232. (health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
  233. }
  234. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  235. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
  236. */
  237.