FlacoBey

Untitled

Feb 20th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include sourcemod
  2. #include sdkhooks
  3. #include sdktools
  4.  
  5. public OnMapStart()
  6. {
  7. CreateTimer( 2.0, Timer_PrecacheModel );
  8. }
  9.  
  10. public Action:Timer_PrecacheModel( Handle:timer )
  11. {
  12. PrecacheModel("models/f18/f18.mdl");
  13. }
  14.  
  15. public OnEntityCreated(entity, const char[] classname)
  16. {
  17. if(StrEqual(classname, "pipe_bomb_projectile"))
  18. {
  19. SDKHook(entity, SDKHook_StartTouchPost, OnTouch)
  20. SetEntityModel(entity, "models/f18/f18.mdl")
  21. }
  22. }
  23.  
  24. public OnTouch(int entity, int other)
  25. {
  26. if (!other)
  27. {
  28. SetEntityMoveType(entity, MOVETYPE_NONE);
  29.  
  30. }
  31. else if(other)
  32. {
  33. SetEntityMoveType(entity, MOVETYPE_NONE);
  34. }
  35. }
  36.  
  37. public OnEntityDestroyed(entity)
  38. {
  39. if(IsValidEntity(entity))
  40. {
  41. char classname[32];
  42. GetEntityClassname(entity, classname, sizeof(classname))
  43. if(StrEqual(classname, "pipe_bomb_projectile"))
  44. {
  45. SDKUnhook(entity, SDKHook_StartTouchPost, OnTouch)
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment