Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #pragma semicolon 1
  2. #pragma newdecls required
  3.  
  4. #include sdktools
  5.  
  6. bool All;
  7.  
  8. public void OnMapStart()
  9. {
  10. All = true;
  11. }
  12.  
  13. public void OnEntityDestroyed(int entity)
  14. {
  15. if(All)
  16. {
  17. if(IsValidEntity(entity) && IsValidEdict(entity))
  18. {
  19. char sWeaponEx[56];
  20. GetEntityClassname(entity, sWeaponEx, sizeof(sWeaponEx));
  21.  
  22. if(strcmp(sWeaponEx, "grenade_launcher_projectile") == 0)
  23. {
  24. float vPos[3];
  25. GetEntPropVector(entity, Prop_Send, "m_vecOrigin", vPos);
  26. PointPush(vPos, 100.0, 150.0);
  27. }
  28. else if(strcmp(sWeaponEx, "pipe_bomb_projectile") == 0)
  29. {
  30. float vPos[3];
  31. GetEntPropVector(entity, Prop_Send, "m_vecOrigin", vPos);
  32. PointPush(vPos, 100.0, 150.0);
  33. }
  34. }
  35. }
  36. }
  37.  
  38. public void PointPush(float center[3], float force, float radius)
  39. {
  40. int push = CreateEntityByName("point_push");
  41. DispatchKeyValueFloat(push, "magnitude", force);
  42. DispatchKeyValueFloat(push, "radius", radius);
  43. DispatchKeyValueFloat(push, "inner_radius", force*2);
  44. DispatchKeyValue(push, "spawnflags", "16");
  45. DispatchSpawn(push);
  46. TeleportEntity(push, center, NULL_VECTOR, NULL_VECTOR);
  47. AcceptEntityInput(push, "Enable", -1, -1);
  48. CreateTimer(0.1, DeletePushForce, push);
  49. }
  50.  
  51. public Action DeletePushForce(Handle timer, int push)
  52. {
  53. if(IsValidEntity(push))
  54. AcceptEntityInput(push, "kill");
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement