How does speedometers / Fuel meters work?
#1

I've never understood how these things work can someone explain them?
Reply
#2

its basically math. you calculate the root of addition of squares of the players curreny x and y velocity.

fuel is nothing but ur reducing the value of a var(fuel) by 1 every few seconds.
if that var is 0 then no fuel
Reply
#3

Thank you, can you explain the velocity thing?
Reply
#4

velocity kinda checks your speed i think
Reply
#5

velocity is measured on a global x/y/z plane.

Imagine that the entire GTA-SA 3D worldspace was one large 3D grid.
Moving UP the grid (skyward) will increase your Z position, moving DOWN it will DECREASE your Z position.
Heading North via the minimap I'm pretty sure is +Y, South is -Y, east is +X, west is -X (please correct me if I am wrong.)

So Velocity is simply a value that indicates how many squares you move per player update (client) and in what direction.

GetPlayerVelocity will return 3 values, X, Y, Z.

if you are headed north along the road at 1 gridsquare per update, your velocity SHOULD be (again if I am right with my definition of relativity) X=0, Y=1, Z=0

Having two values as 1, say X=1 Y=1, Z=0 would indicate that you are heading North-East at a rate of 1 gridsquare per update.
Reply
#6

its the number of X and Y coords your passing through every second with respect to the direction.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)