Hio,
ich habe seit paar Monaten schon das Problem das wenn ich mich einlogge oder Connecte mein Tacho Textdraw kommt!!
Aber wie geht das wieder weg?
Code:
new Text:box[MAX_PLAYERS],Text:fahrzeug[MAX_PLAYERS],Text:kmh[MAX_PLAYERS];
new Text:hoehe[MAX_PLAYERS],Text:zustand[MAX_PLAYERS];
new SpeedoON[MAX_PLAYERS];
new Float:sVehicle_X[MAX_VEHICLES], Float:sVehicle_Y[MAX_VEHICLES], Float:sVehicle_Z[MAX_VEHICLES];
box[i] = TextDrawCreate(157.000000,371.000000,"_");
TextDrawUseBox(box[i],1);
TextDrawBoxColor(box[i],0x00000066);
TextDrawTextSize(box[i],270.000000,500.000000);
TextDrawAlignment(box[i],0);
TextDrawBackgroundColor(box[i],0x00000033);
TextDrawFont(box[i],1);
TextDrawLetterSize(box[i],1.000000,5.000000);
TextDrawColor(box[i],0xffffffff);
TextDrawSetOutline(box[i],1);
TextDrawSetProportional(box[i],1);
TextDrawSetShadow(box[i],1);
Function Timer4()
{
new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
new Float:Speedo_HP;
for(new i=0; i<SLOTS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsANoTachoVehicle(GetPlayerVehicleID(i)))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
new str1[256],str2[256],str3[256],str4[256];
if(SpeedoON[i] == 0)
{
TextDrawShowForPlayer(i, box[i]);
TextDrawShowForPlayer(i, fahrzeug[i]); TextDrawShowForPlayer(i, kmh[i]);
TextDrawShowForPlayer(i, hoehe[i]); TextDrawShowForPlayer(i, zustand[i]);
SpeedoON[i] = 1;
}
new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
new veh = GetPlayerVehicleID(i);
GetVehicleVelocity(veh, speed_x, speed_y, speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*120.0; // 136.666667 = kmph // 85.4166672= mph
final_speed_int = floatround(final_speed,floatround_round);
new kmh_anzahl = final_speed_int;
format(str1,sizeof(str1),"Car: ~b~%s",VehicleName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
TextDrawSetString(fahrzeug[i], str1);
if(kmh_anzahl >= 0)
{
format(str2,sizeof(str2),"~b~KM/H: ~w~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
new vehicleid = GetPlayerVehicleID(i);
format(str3,sizeof(str3),"~b~Tank: ~w~%d/%d ~b~Liter", Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)));
TextDrawSetString(hoehe[i], str3);
if(Speedo_HP >= 0)
{
format(str4,sizeof(str4),"~r~Zustand: ~w~%.0f %", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
}
SavePlayerPos[i][sX] = Speedo_X, SavePlayerPos[i][sY] = Speedo_Y, SavePlayerPos[i][sZ] = Speedo_Z;
}
for(new i=0; i<SLOTS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, box[i]);
TextDrawHideForPlayer(i, fahrzeug[i]); TextDrawHideForPlayer(i, kmh[i]);
TextDrawHideForPlayer(i, hoehe[i]); TextDrawHideForPlayer(i, zustand[i]);
TextDrawShowForPlayer(i, Copyright);
SpeedoON[i] = 0;
}
}
}
Hoffe es kann einer helfen
MFG
Moritz