public UpdateTacho()
{
for(new i = 0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && !IsPlayerNPC(i))
{
new Float:Strecke,Float:Geschwindigkeit;
GetVehiclePos(GetPlayerVehicleID(i),X1[i],Y1[i],Z1[i]);
Strecke = 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 = (Strecke / (TACHOTIMER/1000)) * 2.8;
new String[256];
TextDrawSetString(Tacho[i], String);
format(String,256,"Geschwindigkeit: ~g~%d km/h ~n~~w~Fahrzeugtyp: ~g~%s ~n~~w~Benzin:~g~%i%",floatround(Geschwindigkeit), Fahrzeugname[GetVehicleModel(GetPlayerVehicleID(i))-400], Tank[i]);
GetVehiclePos(GetPlayerVehicleID(i),X2[i],Y2[i],Z2[i]);
TextDrawShowForPlayer(i,Tacho[i]);
} else {
TextDrawHideForPlayer(i,Tacho[i]);
}
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new car = GetPlayerVehicleID(playerid);
if(GetVehicleModel(car) != 509 && GetVehicleModel(car) != 481 && GetVehicleModel(car) != 510)
{
new str[128];
if(Tank[car] <= 10) format(str,sizeof str,"~w~Tank: ~r~%i%",Tank[car]);
if(Tank[car] <= 50) format(str,sizeof str,"~w~Tank: ~o~%i%",Tank[car]);
if(Tank[car] <= 75) format(str,sizeof str,"~w~Tank: ~y~%i%",Tank[car]);
if(Tank[car] <= 100) format(str,sizeof str,"~w~Tank: ~g~%i%",Tank[car]);
TextDrawSetString(Anzeige[playerid],str);
} else
{
TextDrawSetString(Anzeige[playerid],"");
}
}
return 1;
}
Bis gestern ging mein Tacho noch, heute kommt nur noch die Tacho Anzeige, jemand ne Ahnung was das sein könnte? :<