Guten Abend Breadfish,
ich habe heute einen Tacho mit Zeiger gescriptet.
Nun habe ich folgenden Error bekommen mit crashdetekt.
Ich weiß nur nicht wo der Fehler im Code liegt.
public TachoMeter() {
for(new i;i<MAX_PLAYERS;i++) {
if(IsPlayerInAnyVehicle(i)) {
new veh = GetPlayerVehicleID(i),speed = GetVehicleSpeed(veh);
new Float:X = 538.0,Float:Y = 365.0,Float:A = 30.0 + (speed * 1.4);
if(A>320.0) A = 320.0;
for(new t;t<7;i++)
{
X += (4.0 * floatsin(-A,degrees));
Y += (4.0 * floatcos(-A,degrees));
if(PlayerSD[i][t] != (PlayerText:-1))
{
PlayerTextDrawHide(i,PlayerSD[i][t]);
PlayerTextDrawDestroy(i,PlayerSD[i][t]);
}
PlayerSD[i][t] = CreatePlayerTextDraw(i,X,Y,".");
PlayerTextDrawAlignment(i,PlayerSD[i][t],2);
PlayerTextDrawBackgroundColor(i, PlayerSD[i][t], 255);
PlayerTextDrawFont(i, PlayerSD[i][t], 1);
PlayerTextDrawLetterSize(i, PlayerSD[i][t], 0.669999, 2.399998);
PlayerTextDrawColor(i, PlayerSD[i][t], 0xFF0000FF);
PlayerTextDrawSetOutline(i, PlayerSD[i][t], 0);
PlayerTextDrawSetProportional(i, PlayerSD[i][t], 1);
PlayerTextDrawSetShadow(i, PlayerSD[i][t], 0);
PlayerTextDrawShow(i,PlayerSD[i][t]);
}
KMStand[veh] += float(speed)/ 20.0;
if(KMStand[veh] >= 3000.0)
{
KMStand[veh] = 0;
Kilometerstand[veh] += 1.0;
new stand[128], stan = floatround(Kilometerstand[veh]);
format(stand,sizeof(stand),"%07i",stan);
PlayerTextDrawSetString(i,MilageDraw[i],stand);
PlayerTextDrawShow(i,MilageDraw[i]);
}
}
}
new uhr[30];
new hour,second;
gettime(hour,minute,second);
format(uhr,sizeof(uhr),"%02d:%02d:%02d",hour,minute,second);
TextDrawSetString(TextDraws[2][Uhr],uhr);
if(hour == 23)
{
SetTimer("TagSetzen",65000,0);
}
return 1;
}
Danke im Vorraus
Helti