[HELP] My speedometer
#1

hey guys, i got some problem with my speedometer code..
like, im driving a a car, and when i get to its max speed it goest back to 0
and starting again till its max speed and so on.

i wonder in you would be able to help me with this problem, here is my code anyway:

pawn Код:
// Speedometer
      new Float:distance,value;
      new Float:x, Float:y, Float:z;
      GetPlayerPos(playerid, x, y, z);
      distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[playerid][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[playerid][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[playerid][LastZ])),2));
        value = floatround(distance * 11000);
        new Speed = floatround(value/2400);
       
      SavePlayerPos[playerid][LastX] = x;
      SavePlayerPos[playerid][LastY] = y;
      SavePlayerPos[playerid][LastZ] = z;
thanks for the helpers
yuval.
Reply
#2

anyone?
Reply
#3

remove the speedometer man and reinstall
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)