Hey,
aus irgend einem grund wird mein Tacho Textdraw nicht angezeigt
kann mir jemand helfen?
SetTimer("UpdateTacho",TACHOTIMER,1);
public OnGameModeInit()
{
for(new x = 0; x < MAX_PLAYERS; x++)
{
Tacho[x] = TextDrawCreate(357.000, 340.0000, " ");
TextDrawLetterSize(Tacho[x], 0.4,1.1);
TextDrawFont(Tacho[x], 2);
TextDrawSetShadow(Tacho[x], 2);
TextDrawSetOutline(Tacho[x],1);
}
}
public UpdateTacho()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) /*GetPlayerState(i) == PLAYER_STATE_DRIVER &&*/ && IsPlayerInAnyVehicle(i) && !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)) * 3.6;
new String[50];
format(String,sizeof(String),"%d Km/h ",floatround(Geschwindigkeit));
GetVehiclePos(GetPlayerVehicleID(i),X2[i],Y2[i],Z2[i]);
TextDrawShowForPlayer(i,Tacho[i]);
TextDrawSetString(Tacho[i],String);
}
else
{
TextDrawHideForPlayer(i,Tacho[i]);
}
}
return 1;
}