Vehicle distance.
#1

Hi all.Maybe somebody know how to get all vehicle distance,and save it?
Reply
#2

What do you mean, vehicle distance ?
Reply
#3

You maybe mean coordinates?
Reply
#4

No. i don't know how it say correct in your language,it's like run with vehicle distance.
Reply
#5

Are you talking about the 'Stunt Bonus' as in the San Andreas Single Player?
Reply
#6

No no.But i do it myself it look like that:

Код:
new Float:ST[4];
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 180.3;

vehicleDB[vehicleid][prav] += ST[3];
And i use:

Код:
vehicleDB[vehicleid][prav]/10000 to get correct.
Reply
#7

You mean the speed?
Reply
#8

i think its about a "taxo-meter". the distance travelled so far...
the squareroot is a good beginning. but instead of using the vehiclevelocity:

store actual vehicle position in an array (x_old,y_old,z_old).
wait some time (timer?), let the player drive some distance.
get his vehicles position again (store it into another array, this time x_new,y_new,z_new), and subtract each values like
new x_travelled= x_old-x_new;
new y_travelled= y_old-z_new;
new z_travelled= y_old-z_new;
you will get some "delta"values, the travelled distances in each axis:
x_travelled=123.4560
y_travelled=-80.0000
z_travelled=1.0131
dont worry about negative values. powering them will make them positive...
after adding the newly calculated "short time" distance to the ever-lasting counter:
x_travelled_atall+=travelledX;
, dont forget to copy the x_new into the x_old coordinate, so the next call will use the x_new as x_old, since the x_new will get calced again..
Reply
#9

I don't understand here nothing.Maybe you have time and can my make a meter?
Reply
#10

budelis use ****** Translete if you cant say
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)