- 20
- 20
- Версия SA-MP
-
- Любая
Wrote a small script that prevents your car from rolling over. How it works: the script directly corrects the angular velocity of the vehicle — no teleportation, no sudden visual effects.
Works with all car types. Motorcycles, planes, helicopters and RC vehicles are excluded automatically.
Activation: automatic.
Autor: Niourozi (me)
v1.1 update
- Added wheel contact detection using CVehicle suspension offsets (smooth copy at base+0x4B0).
Reads all 4 wheel compression values each tick to confirm how many wheels are actually
off the ground before acting, instead of relying solely on upZ + rightZ.
- Rollover detection split into 3 stages:
TIPPING (upZ < 0.65) → light turn speed damping
FLIPPED (upZ < 0.20, 3+ wheels up) → strong damping + corrective angular impulse
INVERTED (upZ < 0) → full matrix recovery
- Full flip recovery for completely inverted vehicles: rewrites the rotation matrix to
upright preserving the current heading, zeroes angular velocity, dampens linear speed,
and lifts the car slightly to avoid immediate ground re-collision. Triggers on the
first tick upZ goes below 0 so the engine doesn't accumulate collision damage.
- Tick rate reduced from 30ms to 25ms.
- Per-stage cooldowns instead of a single global one (100 / 200 / 800ms).
v1.2 update
Works with all car types. Motorcycles, planes, helicopters and RC vehicles are excluded automatically.
Activation: automatic.
Autor: Niourozi (me)
v1.1 update
- Added wheel contact detection using CVehicle suspension offsets (smooth copy at base+0x4B0).
Reads all 4 wheel compression values each tick to confirm how many wheels are actually
off the ground before acting, instead of relying solely on upZ + rightZ.
- Rollover detection split into 3 stages:
TIPPING (upZ < 0.65) → light turn speed damping
FLIPPED (upZ < 0.20, 3+ wheels up) → strong damping + corrective angular impulse
INVERTED (upZ < 0) → full matrix recovery
- Full flip recovery for completely inverted vehicles: rewrites the rotation matrix to
upright preserving the current heading, zeroes angular velocity, dampens linear speed,
and lifts the car slightly to avoid immediate ground re-collision. Triggers on the
first tick upZ goes below 0 so the engine doesn't accumulate collision damage.
- Tick rate reduced from 30ms to 25ms.
- Per-stage cooldowns instead of a single global one (100 / 200 / 800ms).
v1.2 update
Вложения
Последнее редактирование: