MegastoRM

Untitled

Feb 21st, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1.  
  2. register_touch("mortar", "*" , "DodirRakete");
  3.  
  4.  
  5. public Nade_Touch(ent)
  6. {
  7. if(!pev_valid(ent))
  8. return FMRES_IGNORED
  9.  
  10. new attacker = pev(ent, pev_owner);
  11. new Float:entOrigin[3], Float:fDamage, Float:Origin[3];
  12. pev(ent, pev_origin, entOrigin);
  13. entOrigin[2] += 1.0;
  14.  
  15. new Float:xm320_damage = get_pcvar_float(PCvarDamage);
  16. new Float:xm320_radius = get_pcvar_float(PCvarRadius);
  17.  
  18. new entlist[33];
  19. new numfound = find_sphere_class(ent, "player", xm320_radius, entlist, 32);
  20.  
  21. for (new i=0; i < numfound; i++)
  22. {
  23. new pid = entlist[i];
  24.  
  25. if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
  26. continue;
  27. ExecuteHam(Ham_TakeDamage, pid, ent, attacker, float(xm320_damage)) , 1);
  28. }
  29. emit_sound(ent, CHAN_WEAPON, XM320_EXPLO, 1.0, ATTN_NORM, 0, PITCH_NORM)
  30. message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  31. write_byte(TE_EXPLOSION);
  32. write_coord(floatround(entOrigin[0]));
  33. write_coord(floatround(entOrigin[1]));
  34. write_coord(floatround(entOrigin[2]));
  35. write_short(explo);
  36. write_byte(40);
  37. write_byte(30);
  38. write_byte(14);
  39. message_end();
  40.  
  41. message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  42. write_byte(TE_EXPLOSION);
  43. write_coord(floatround(entOrigin[0]));
  44. write_coord(floatround(entOrigin[1]));
  45. write_coord(floatround(entOrigin[2]));
  46. write_short(blast);
  47. write_byte(40);
  48. write_byte(30);
  49. write_byte(TE_EXPLFLAG_NONE);
  50. message_end();
  51.  
  52. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  53. write_byte(5)
  54. write_coord(floatround(entOrigin[0]));
  55. write_coord(floatround(entOrigin[1]));
  56. write_coord(floatround(entOrigin[2]));
  57. write_short(smoke);
  58. write_byte(35);
  59. write_byte(5);
  60. message_end();
  61.  
  62. remove_entity(ent);
  63. return FMRES_IGNORED
  64. }
  65.  
  66. public DodirRakete(ent)
  67. {
  68. if ( !is_valid_ent(ent))
  69. return;
  70.  
  71. new attacker = entity_get_edict(ent, EV_ENT_owner);
  72.  
  73. new Float:fOrigin[3];
  74. entity_get_vector(ent, EV_VEC_origin, fOrigin);
  75.  
  76. new iOrigin[3];
  77. for(new i=0;i<3;i++)
  78. iOrigin[i] = floatround(fOrigin[i]);
  79.  
  80. message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
  81. write_byte(TE_EXPLOSION);
  82. write_coord(iOrigin[0]);
  83. write_coord(iOrigin[1]);
  84. write_coord(iOrigin[2]);
  85. write_short(sprite_blast);
  86. write_byte(32); // scale
  87. write_byte(20); // framerate
  88. write_byte(0);// flags
  89. message_end();
  90.  
  91. new entlist[33];
  92. new numfound = find_sphere_class(ent, "player", 230.0, entlist, 32);
  93.  
  94. for (new i=0; i < numfound; i++)
  95. {
  96. new pid = entlist[i];
  97.  
  98. if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24)
  99. continue;
  100. ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 55.0+float(inteligencija_igraca[attacker]) , 1);
  101. }
  102. remove_entity(ent);
  103. }
Advertisement
Add Comment
Please, Sign In to add comment