Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "a_samp"
- #define BB(::) \
- BB__
- new
- Float:v__Pos[MAX_VEHICLES][4], BB_TIMER__;
- stock freezeVehicle (vehicleid)
- {
- GetVehiclePos (vehicleid, v__Pos[vehicleid][0], v__Pos[vehicleid][1], v__Pos[vehicleid][2]);
- GetVehicleZAngle (vehicleid, v__Pos[vehicleid][3]);
- return (true);
- }
- stock unfreezeVehicle (vehicleid)
- {
- v__Pos[vehicleid][0] = (0.000); v__Pos[vehicleid][1] = (0.000); v__Pos[vehicleid][2] = (0.000); v__Pos[vehicleid][3] = (0.000);
- return (true);
- }
- stock bool:isVehicleFreezed (vehicleid)
- {
- if(v__Pos[vehicleid][0] != 0.000 && v__Pos[vehicleid][1] != 0.000 && v__Pos[vehicleid][2] != 0.000) return (true);
- else if(v__Pos[vehicleid][0] == 0.000 && v__Pos[vehicleid][1] == 0.000 && v__Pos[vehicleid][2] == 0.000) return (false);
- return (false);
- }
- BB(::)TIMER_()
- {
- for(new v__ = (0); v__ < MAX_VEHICLES; ++ v__)
- {
- v__Pos[v__][0] = (0.000); v__Pos[v__][1] = (0.000); v__Pos[v__][2] = (0.000); v__Pos[v__][3] = (0.000);
- }
- BB_TIMER__ = SetTimer("_BB_FREEZE_", 200, true);
- }
- BB(::)TIMEROFF_() { KillTimer(BB_TIMER__); }
- forward _BB_FREEZE_();
- public _BB_FREEZE_()
- {
- for(new v__ = 0; v__ < MAX_VEHICLES; ++ v__)
- {
- 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)
- {
- new
- Float:v___POS[4];
- GetVehiclePos (v__, v___POS[0], v___POS[1], v___POS[2]);
- GetVehicleZAngle (v__, v___POS[3]);
- 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])
- {
- SetVehiclePos(v__, v__Pos[v__][0], v__Pos[v__][1], v__Pos[v__][2]);
- SetVehicleZAngle(v__, v__Pos[v__][3]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement