Hey com
Ich hab mir nen Tacho erstellt , mit diesem Tutorial, doch die Kmh Anzeige bleibt auf 0 , und die Lebensanzeige auch !
Hier der Code:
public TachoTimer()
{
for(new i = 0; i MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsPlayerNPC(i))
{
new FloatEntfernung, FloatGeschwindigkeit;
GetVehiclePos(GetPlayerVehicleID(i), X1[i], Y1[i], Z1[i]);
GetVehiclePos(GetPlayerVehicleID(i), X2[i], Y2[i], Z2[i]);
Entfernung = floatsqroot(floatpower(floatabs(floatsub(X1[i], X2[i])), 2)+floatpower(floatabs(floatsub(Y1[i], Y2[i])), 2)+floatpower(floatabs(floatsub(Z1[i], Z2[i])), 2));
Geschwindigkeit = (Entfernung (TachoTimerZeit1000)) 3.6;
new Kmhstring[20];
format(Kmhstring, sizeof(Kmhstring)," Kmh %i", floatround(Geschwindigkeit));
TextDrawSetString(TachoKmh[i], Kmhstring);
TextDrawShowForPlayer(i, TachoKmh[i]);
new lebenstring[20];
new vid=GetPlayerVehicleID(i);
new Floatleben;
format(lebenstring,sizeof(lebenstring),"Leben %f", GetVehicleHealth(vid,leben));
TextDrawSetString(TachoLeben[i],lebenstring);
TextDrawShowForPlayer(i, TachoBox[i]);
TextDrawShowForPlayer(i, TachoMotor[i]);
TextDrawShowForPlayer(i, TachoLichter[i]);
TextDrawShowForPlayer(i, TachoTueren[i]);
TextDrawShowForPlayer(i, TachoPunkto[i]);
TextDrawShowForPlayer(i, TachoPunktu[i]);
TextDrawShowForPlayer(i, TachoTacho[i]);
TextDrawShowForPlayer(i, TachoLeben[i]);
TextDrawShowForPlayer(i, TachoName[i]);
}
else
{
TextDrawHideForPlayer(i, TachoKmh[i]);
TextDrawHideForPlayer(i, TachoBox[i]);
TextDrawHideForPlayer(i, TachoMotor[i]);
TextDrawHideForPlayer(i, TachoLeben[i]);
TextDrawHideForPlayer(i, TachoLichter[i]);
TextDrawHideForPlayer(i, TachoTueren[i]);
TextDrawHideForPlayer(i, TachoPunkto[i]);
TextDrawHideForPlayer(i, TachoPunktu[i]);
TextDrawHideForPlayer(i, TachoTacho[i]);
TextDrawHideForPlayer(i, TachoName[i]);
}
}
return 1;
}