SA-MP Forums Archive
Anti car destroyer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti car destroyer (/showthread.php?tid=629319)



Anti car destroyer - MerryDeer - 24.02.2017

Hi,

https://www.youtube.com/watch?v=jr4w8EblnCQ

How to make anti-cheat from this?


Re: Anti car destroyer - Private200 - 24.02.2017

Server side vehicle health will do the job. A function to detect vehicle collision so you may get the new health of the vehicle and you are ready to go. In less words, the scheme would be like:

1. Do a function that would detect vehicle health changing (either by OnPlayerUpdate and CallLocalFunction or a pre-made function like this, already out in the forums).
2. Create a vehicle like VehicleHealth[MAX_VEHICLES], and set its value to the new vehicle's health every time the OnVehicleHealthChange is called (from step one)
3. OnVehicleDestroyed, if health was not lower than a specific amount (around 300), then spawn the vehicle back to the player.

There's no specific way to prevent this. At least, no possible method passing through my mind right now.