Das sind die Fehler:
C:\Dokumente und Einstellungen\Cedric\Eigene Dateien\Dropbox\samp03x_svr_R2_win32\gamemodes\reallife.pwn(800) : warning 235: public function lacks forward declaration (symbol "TachoTimer")
+
C:\Dokumente und Einstellungen\Cedric\Eigene Dateien\Dropbox\samp03x_svr_R2_win32\gamemodes\reallife.pwn(11) : error 021: symbol already defined: "SetTimer"
Zeile 11
SetTimer("TachoTimer",TACHOTIMER,1);
Zeile 800:
public TachoTimer()
Gesamter Code:
public TachoTimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
new Float:Entfernung, Float:Geschwindigkeit;
GetVehiclePos(GetPlayerVehicleID(i), X1[i], Y1[i], Z1[i]);
Entfernung = 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 = (Entfernung / (TACHOTIMER/1000)) * 3.6;
new Tachostring[20];
format(Tachostring, sizeof(Tachostring), "Km/h: %d", floatround(Geschwindigkeit));
TextDrawSetString(Tacho[i], Tachostring);
GetVehiclePos(GetPlayerVehicleID(i), X2[i], Y2[i], Z2[i]);
TextDrawShowForPlayer(i, Tacho[i]);
}
else
{
TextDrawHideForPlayer(i, Tacho[i]);
}
}
return 1;
}
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
new Float:Entfernung, Float:Geschwindigkeit;
GetVehiclePos(GetPlayerVehicleID(i), X1[i], Y1[i], Z1[i]);
Entfernung = 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 = (Entfernung / (TACHOTIMER/1000)) * 3.6;
new Tachostring[20];
format(Tachostring, sizeof(Tachostring), "Km/h: %d", floatround(Geschwindigkeit));
TextDrawSetString(Tacho[i], Tachostring);
GetVehiclePos(GetPlayerVehicleID(i), X2[i], Y2[i], Z2[i]);
TextDrawShowForPlayer(i, Tacho[i]);
}
else
{
TextDrawHideForPlayer(i, Tacho[i]);
}
}
return 1;
}