Advertisement
Guest User

Untitled

a guest
Jan 15th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. #include "a_samp"
  2.  
  3. #define BB(::) \
  4. BB__
  5.  
  6. new
  7. Float:v__Pos[MAX_VEHICLES][4], BB_TIMER__;
  8.  
  9. stock freezeVehicle (vehicleid)
  10. {
  11. GetVehiclePos (vehicleid, v__Pos[vehicleid][0], v__Pos[vehicleid][1], v__Pos[vehicleid][2]);
  12. GetVehicleZAngle (vehicleid, v__Pos[vehicleid][3]);
  13. return (true);
  14. }
  15.  
  16. stock unfreezeVehicle (vehicleid)
  17. {
  18. v__Pos[vehicleid][0] = (0.000); v__Pos[vehicleid][1] = (0.000); v__Pos[vehicleid][2] = (0.000); v__Pos[vehicleid][3] = (0.000);
  19. return (true);
  20. }
  21.  
  22. stock bool:isVehicleFreezed (vehicleid)
  23. {
  24. if(v__Pos[vehicleid][0] != 0.000 && v__Pos[vehicleid][1] != 0.000 && v__Pos[vehicleid][2] != 0.000) return (true);
  25. else if(v__Pos[vehicleid][0] == 0.000 && v__Pos[vehicleid][1] == 0.000 && v__Pos[vehicleid][2] == 0.000) return (false);
  26. return (false);
  27. }
  28.  
  29. BB(::)TIMER_()
  30. {
  31. for(new v__ = (0); v__ < MAX_VEHICLES; ++ v__)
  32. {
  33. v__Pos[v__][0] = (0.000); v__Pos[v__][1] = (0.000); v__Pos[v__][2] = (0.000); v__Pos[v__][3] = (0.000);
  34. }
  35. BB_TIMER__ = SetTimer("_BB_FREEZE_", 200, true);
  36. }
  37.  
  38. BB(::)TIMEROFF_() { KillTimer(BB_TIMER__); }
  39.  
  40. forward _BB_FREEZE_();
  41. public _BB_FREEZE_()
  42. {
  43. for(new v__ = 0; v__ < MAX_VEHICLES; ++ v__)
  44. {
  45. if(v__Pos[v__][0] != 0.000 && v__Pos[v__][1] != 0.000 && v__Pos[v__][2] != 0.000 && v__Pos[v__][3] != 0.000)
  46. {
  47. new
  48. Float:v___POS[4];
  49. GetVehiclePos (v__, v___POS[0], v___POS[1], v___POS[2]);
  50. GetVehicleZAngle (v__, v___POS[3]);
  51. if(v___POS[0] != v__Pos[v__][0] || v___POS[1] != v__Pos[v__][1] || v___POS[2] != v__Pos[v__][2] || v___POS[3] != v__Pos[v__][3])
  52. {
  53. SetVehiclePos(v__, v__Pos[v__][0], v__Pos[v__][1], v__Pos[v__][2]);
  54. SetVehicleZAngle(v__, v__Pos[v__][3]);
  55. }
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement