SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 14/12/2011, 05:54 PM   #21
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,494
Reputation: 70
Default Re: Sgt's Vehicle Functions

should be fixed now (re-download)
__________________
Don't bother to contact me, I'm out of SA-MP
Sascha is offline   Reply With Quote
Old 14/12/2011, 11:07 PM   #22
vincee
Big Clucker
 
vincee's Avatar
 
Join Date: Sep 2011
Posts: 85
Reputation: 5
Default Re: Sgt's Vehicle Functions

THANK FUCK FOR THIS
__________________
vincee is offline   Reply With Quote
Old 08/01/2016, 08:18 PM   #23
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,494
Reputation: 70
Default Re: Sgt's Vehicle Functions

Little update for those who are interested in this, still:
I've just got a message by SupperRobin6394 who told me about a little mistake in this script, that occurs on line 163..
Sadly I forgot a little "v" in this line, so if you are having this problem, either just download the replaced version I've updated to the internal and the external download links, or simply replace the following function with the following code:
Code:
stock GetVehicleSpeed(vehicleid)
{
	new Float:v[4];
	GetVehicleVelocity(vehicleid, v[0], v[1], v[2]);
	v[3] = floatsqroot((v[0] * v[0]) + (v[1] * v[1]) + (v[2] * v[2]));
	return float_round(v[3], floatround_round);
}
Sorry and thanks.
__________________
Don't bother to contact me, I'm out of SA-MP
Sascha is offline   Reply With Quote
Old 08/01/2016, 08:28 PM   #24
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,883
Reputation: 1321
Default Re: Sgt's Vehicle Functions

That is not how you get the speed of a vehicle and it should be returned as a float.
Pottus is offline   Reply With Quote
Old 08/01/2016, 08:44 PM   #25
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,494
Reputation: 70
Default Re: Sgt's Vehicle Functions

Quote:
Originally Posted by Pottus View Post
That is not how you get the speed of a vehicle and it should be returned as a float.
A few things to that:
First, you're right in a way, there are a few nicer ways to get the actual speed now
Second, this version is about 5 years old
And third, in fact you are wrong, 'cause this will return a velocity of the vehicle - It will although not return any velocity that you could use in mp/h or km/h or whichever unit you would like to get. This was originally done because everyone should be able to transform it into a kind of speed unit they like to. But in fact it gets the x y and z velocity and sums up these vectors to a absolute speed vector.
As far as I know a velocity doesn't require to be a float, most speedos actually just show it as an rounded integer value.

So to sum it up, it actually returns a vehicle speed - maybe not how you would want to use it, although I aint saying anything about efficiency.
(As said, this thing hasn't been updated for around 4~5 years, so I wouldn't bother to discus this function, I doubt it's commonly used anymore)
__________________
Don't bother to contact me, I'm out of SA-MP
Sascha is offline   Reply With Quote
Old 30/03/2020, 02:20 AM   #26
albert12
Little Clucker
 
Join Date: Dec 2019
Location: Tunisia
Posts: 8
Reputation: 0
Default Re: Sgt's Vehicle Functions

please update the link!
albert12 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Sgt's Driving License Sascha Filterscripts 19 02/08/2013 10:58 AM
[Include] [INC] Vehicle functions v0.2.1 R2 kurta999 Includes 8 25/03/2011 06:19 PM
[FilterScript] [FS] Vehicle Functions aircombat Filterscripts 19 25/08/2010 12:41 AM
[FilterScript] [FS] Vehicle Functions (Engine, Fuel, Car Names) Homerman Filterscripts 120 03/01/2010 10:22 AM


All times are GMT. The time now is 12:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.