public SpeedoTimer()
{
}
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 str2[256],str3[256],str4[256];
if(SpeedoON[i] == 0)
{
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),"Fahrzeug: ~y~%s",VehicleName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
//TextDrawSetString(fahrzeug[i], str1);
if(kmh_anzahl >= 150)
{
format(str2,sizeof(str2),"KM/h: ~r~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 100)
{
format(str2,sizeof(str2),"KM/h: ~y~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 50)
{
format(str2,sizeof(str2),"KM/h: ~g~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else
{
format(str2,sizeof(str2),"KM/h: ~b~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
new vehicleid = GetPlayerVehicleID(i);
format(str3,sizeof(str3),"Tank: ~b~%d ~w~Liter", Gas[vehicleid]);
TextDrawSetString(hoehe[i], str3);
if(Speedo_HP >= 551)
{
format(str4,sizeof(str4),"Schaden: ~g~%.1f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
else if(Speedo_HP >= 361)
{
format(str4,sizeof(str4),"Schaden: ~y~%.1f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
else
{
format(str4,sizeof(str4),"Schaden: ~r~%.1f", Speedo_HP);
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, fahrzeug[i]); TextDrawHideForPlayer(i, kmh[i]);
TextDrawHideForPlayer(i, hoehe[i]); TextDrawHideForPlayer(i, zustand[i]);
//TextDrawShowForPlayer(i, Copyright);
SpeedoON[i] = 0;
}
}
}
Wenn ich compile schreibt er mir das er nicht mehr geht wisst ihr warum ^^?