Guten Tag,
wenn man ins Fahrzeug steig und das Tacho kommt, fängt der Server an zu Laggen.
Das Tacho zieht 400kbs.
Weiß jemand, an was das liegen kann?!
Code:
public Updating(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new str[256];
PlayerTextDrawShow(playerid,TT_1[playerid]);
format(str,sizeof(str),"_______",Gas[vehicleid]);
PlayerTextDrawSetString(playerid,TT_1[playerid],str);
PlayerTextDrawTextSize(playerid,TT_1[playerid], 20.0000000,Gas[vehicleid]*0.8);
}
else
{
PlayerTextDrawHide(playerid,TT_1[playerid]);
}
return 1;
}
public SekundenTimer6()
{
new string[50],
Float:maxspeed = 200.0,
playername[MAX_PLAYER_NAME],
value,
Float:xX,
Float:yY,
Float:zZ,
Float:x,
Float:Y,
Float:Z;
ForAllPlayers(i){if(IsPlayerConnected(i) && gPlayerLogged[i] && !IsPlayerNPC(i) && AFKModus[i] == 0)
{
DestroyPickup(TotenKopf[i]);
new vehicleid;
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsANoTachoVehicle(GetPlayerVehicleID(i) && Gas[vehicleid]))
{
vehicleid = GetPlayerVehicleID(i);
//new veh=GetPlayerVehicleID(playerid);
new VEH = GetPlayerVehicleID(i);
}
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) && Gas[vehicleid]))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
new str1[50],str2[50],str3[50],str4[50];
if(SpeedoON[i] == 0)
{
PlayerTextDrawShow(i, TT_1[i]);
TextDrawShowForPlayer(i, box[i]); TextDrawShowForPlayer(i, fahrzeug[i]); TextDrawShowForPlayer(i, kmh[i]);
TextDrawShowForPlayer(i, fahrzeugname[i]);
TextDrawShowForPlayer(i, tank2[i]); TextDrawShowForPlayer(i, zustand[i]); TextDrawShowForPlayer(i, tFuelInfo[i]);
TextDrawShowForPlayer(i, tFuelLogo[i]);
TextDrawShowForPlayer(i, Tankbox[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))*136.666667; // 136.666667 = kmph // 85.4166672= mph
final_speed_int = floatround(final_speed,floatround_round);
new kmh_anzahl = final_speed_int;
format(str1,sizeof(str1),"~g~%s",VehNames[GetVehicleModel(GetPlayerVehicleID(i))-400]);
TextDrawSetString(fahrzeugname[i], str1);
if(kmh_anzahl >= 210)
{
format(str2,sizeof(str2),"~w~%d ~r~KM/H",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 150)
{
format(str2,sizeof(str2),"~w~%d ~y~KM/H",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 90)
{
format(str2,sizeof(str2),"~w~%d ~y~KM/H",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 40)
{
format(str2,sizeof(str2),"~w~%d ~g~KM/H",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else
{
format(str2,sizeof(str2),"~w~%d ~g~KM/H",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
new vehicleid = GetPlayerVehicleID(i);
format(str3,sizeof(str3),"%d%", Gas[vehicleid]);
TextDrawSetString(tank2[i], str3);
if(Speedo_HP >= 551)
{
format(str4,sizeof(str4),"~y~Zustand: ~w~%.2f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
else if(Speedo_HP >= 361)
{
format(str4,sizeof(str4),"~y~Zustand: ~w~%.2f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
else
{
format(str4,sizeof(str4),"~y~Zustand: ~w~%.2f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
}
SavePlayerPos[i][sX] = Speedo_X, SavePlayerPos[i][sY] = Speedo_Y, SavePlayerPos[i][sZ] = Speedo_Z;
}
for(new s=0; s<SLOTS; s++)
{
if(!IsPlayerInAnyVehicle(i))
{
PlayerTextDrawHide(i, TT_1[i]);
TextDrawHideForPlayer(i, box[i]); TextDrawHideForPlayer(i, fahrzeug[i]); TextDrawHideForPlayer(i, kmh[i]);
TextDrawHideForPlayer(i, fahrzeugname[i]);
TextDrawHideForPlayer(i, tank2[i]); TextDrawHideForPlayer(i, zustand[i]); TextDrawHideForPlayer(i, tFuelInfo[i]);
TextDrawHideForPlayer(i, tFuelLogo[i]);
TextDrawHideForPlayer(i, Tankbox[i]);
SetTimerEx("Updating",16500,1,"i",i);
SpeedoON[i] = 0;
}
}