SA-MP Forums Archive
[Include] dth_vehspeed - Control the speed of a vehicle - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] dth_vehspeed - Control the speed of a vehicle (/showthread.php?tid=585520)



dth_vehspeed - Control the speed of a vehicle - Dutheil - 14.08.2015

dth_vehspeed v0.3 - Control the speed of a vehicle
With that include easily control the vehicle speed of your server.
Contents :
Informations :
As you will see in the parameters of 2 functions, you will be asked if you want to call these functions in km/h or mp/h.

PHP код:
native ConvertKmhToMph(const kmh);
native ConvertMphToKmh(const mph);
native GetVehicleSpeed(const vehicleid, const dth_speed_unit:unit=kmh);
native SetVehicleSpeed(const vehicleidspeed, const dth_speed_unit:unit=kmh);
native GetSpeedByMilliseconds(const speed, const milliseconds);
native GetVehicleModelTopSpeed(const modelid); 
With these functions, you can create a speedometer, a speed limiter, cruise control, and mileage system easily.

Download :





Cruise control made by Sellize with this include :
[ame]http://www.youtube.com/watch?v=plVOzpO5iPM[/ame]



Re: dth_vehspeed - Control the speed of a vehicle - kalanerik99 - 14.08.2015

Nice one!
Keep on with great work!


Re: dth_vehspeed - Control the speed of a vehicle - JR_Junior - 15.08.2015

Edit: Wrong post


Re : dth_vehspeed - Control the speed of a vehicle - Dutheil - 15.08.2015

Include updated, adding function :
PHP код:
native GetSpeedByMilliseconds(const speed, const milliseconds); 
Useful for a mileage system.


Re: dth_vehspeed - Control the speed of a vehicle - iWhite - 15.08.2015

Can this system make faster vehicles or just limit speed?


Re: dth_vehspeed - Control the speed of a vehicle - LazyB0y - 15.08.2015

Good Job !


Re : dth_vehspeed - Control the speed of a vehicle - Dutheil - 18.08.2015

Quote:
Originally Posted by iWhite
Посмотреть сообщение
Can this system make faster vehicles or just limit speed?
You can do both.
Quote:
Originally Posted by LazyBoyyyy
Посмотреть сообщение
Good Job !
Thanks!


Re : dth_vehspeed - Control the speed of a vehicle - Dutheil - 18.08.2015

Include updated, adding function :
PHP код:
native GetVehicleModelTopSpeed(const modelid); 



Re: dth_vehspeed - Control the speed of a vehicle - Crayder - 19.08.2015

Perhaps you should prevent the bug at the end? XD

1. White screen of death.
2. It thought you were at the bomb shop.
3. It didn't make you go the speed specified.

I really like this though, the speed is still off a bit (as are all other speedo scripts and mine), but it's only GTASA. Also you could get more advanced into the speed. Like, if we were falling this script would return the terminal velocity. You should make it so it only detects actually movement speed and not displacement speed.


EDIT: Why aren't you using float values?!!?!