Speedometer help
#1

How to code speedometer texdraw?
texdraw have, how to if oplayer enter vehicle show texdraw or exit - hide
Reply
#2

Use this
https://sampforum.blast.hk/showthread.php?tid=505003
Or
https://sampforum.blast.hk/showthread.php?tid=358810
Reply
#3

Do you even check what you post?

1'st link - Coded incorrectly
2'nd link - Doesn't work
Reply
#4

Calm down, man.
Reply
#5

I am calm, I asked you a question.
Reply
#6

error 017: undefined symbol "GetVehicleSpeed" how to fix?
Reply
#7

pawn Код:
GetVehicleSpeed( vehicleid )
{
    new Float:x, Float:y, Float:z, vel;
    GetVehicleVelocity( vehicleid, x, y, z );
    vel = floatround( floatsqroot( x*x + y*y + z*z ) * 180 );
    return vel;
}
Reply
#8

forward Speedometer(playerid);
public Speedometer(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new vehicleid = GetPlayerVehicleID(playerid);
new string[32], string2[32], string3[10], Float:vhealth;
format(string, sizeof(string), "%s", VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(Spidometras[playerid][9], string);

format(string2, sizeof(string2), "%i", GetVehicleSpeed(vehicleid));
TextDrawSetString(Spidometras[playerid][6], string2);

}
return 1;
}

how to fix this code doesn't work does'nt see speed and vehiclename
Reply
#9

Fixed thanks for help +R3P
Reply
#10

Quote:
Originally Posted by Pottus
Посмотреть сообщение
pawn Код:
GetVehicleSpeed( vehicleid )
{
    new Float:x, Float:y, Float:z, vel;
    GetVehicleVelocity( vehicleid, x, y, z );
    vel = floatround( floatsqroot( x*x + y*y + z*z ) * 180 );
    return vel;
}
Note that you can replace
pawn Код:
floatsqroot( x*x + y*y + z*z )
With the new VectorSize function, which ought to be faster.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)