Speedo problem
#1

Can someone tell me why this speedometer code doesn't work??

pawn Код:
if(IsPlayerInAnyVehicle(i))
                {
                new s[128],Float:health,vehicleid = GetPlayerVehicleID(i);
                format(s, sizeof(s), "~g~%d ~w~km/h - ~g~%.2f ~w~hp", GetVehicleSpeed(vehicleid), health);
                TextDrawSetString(KillsTxd[i], s);
                TextDrawShowForPlayer(i, Speedo[0][i]);
                TextDrawShowForPlayer(i, Speedo[1][i]);
                }
                else
                {
                TextDrawHideForPlayer(i, Speedo[0][i]);
                TextDrawHideForPlayer(i, Speedo[1][i]);
                }
I have it in a timer. Is supposed to show vehicle speed in km/h and current hp..but both doesnt update.
Reply
#2

Stupid question from me maybe, but have you debugged the code? Like, putting print statements around the timer (most important of all, inside the code you showed above)? I solved a lot of my problems like that most of the time.
Reply
#3

You're not even getting any health at all. It's just an empty variable.
Reply
#4

@Vince omg About the health i fixed, about the speed? Jstylezz i debugged already
Reply
#5

Post the GetVehicleSpeed function.

Just thought I'd state the obvious that you're not even setting the speedometer string.
Reply
#6

Ah no, fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)