Code
forward Tachometer(playerid);
public Tachometer(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && (GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
new Final,
Temp[128],
VehicleID,
model,
Float:CarHealth,
CarHealthIni,
Float:Tank;
VehicleID = GetPlayerVehicleID(playerid);
model = GetVehicleModel(VehicleID);
if(IsAFahrrad(model))return 1;
Tank = pVehicle[VehicleID][vehicleFuel];
GetVehicleHealth(VehicleID, CarHealth);
CarHealthIni = floatround((CarHealth - 250.0) / 7.5, floatround_floor);
if(CarHealthIni < 0) CarHealthIni = 0;
format(Temp, sizeof(Temp), "~b~Tank: ~w~%.1f/%.0f ~b~L",Tank, VehicleData[GetVehicleModel(VehicleID)-400][vehMaxTank]);
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][1], Temp);
format(Temp, sizeof(Temp), "~b~KM-Stand:~w~ %.1f", pVehicle[VehicleID][vehKMStand]);
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][2], Temp);
format(Temp, sizeof(Temp), "~b~%s: ~w~%d%", Fahrzeugname[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400], CarHealthIni);
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][3], Temp);
format(Temp, sizeof(Temp), "~w~%d ~b~km/h", Final);
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][4], Temp);
if(Tank <= 5.0)
{
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
}
if(Final > 319)
{
if(!pInfo[playerid][pSpeedwarning])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerLoggedIn(i))
continue;
if(pInfo[i][pAdmin])
{
new strTemp[512];
format(strTemp, 512, "Spieler %s steht unter Speedhack verdacht! (KM/H: %i)", Playername(playerid), Final);
SendClientMessage(i, COLOR_ORANGE, strTemp);
}
}
pInfo[playerid][pSpeedwarning] = true;
}
}
if(Final >= 60 && !pInfo[playerid][pBlitzerCooldown] && !pInfo[playerid][pDuty])
{
for(new i = 0; i < MAX_BLITZER; i++)
{
if(!pBlitzer[i][rBlitzerExists])
continue;
if(IsPlayerInRangeOfPoint(playerid, 30.0, pBlitzer[i][rBlitzerPosX], pBlitzer[i][rBlitzerPosY], pBlitzer[i][rBlitzerPosZ]))
{
if(pBlitzer[i][rBlitzerSpeed] < Final)
{
pInfo[playerid][pBlitzerCooldown] = true;
new Differenz;
Differenz = Final - pBlitzer[i][rBlitzerSpeed];
format(Temp, 256, "Du wurdest mit einer Geschwindigkeit von %i KM/H geblitzt! (Kosten: $%i)", Final, Differenz * 9);
GiveMoney(playerid, -(Differenz * 9));
PlayerPlaySound(playerid, 1132, 0, 0, 0);
SendClientMessage(playerid, COLOR_YELLOW, Temp);
SetTimerEx("BlitzerReset", 1000 * 10, false, "i", playerid);
format(Temp, 256, "Spieler %s wurde mit einer Geschwindigkeit von %i KM/H geblitzdingst! (Kosten: $%i)", Playername(playerid), Final, Differenz * 9);
for(new j = 0; j < MAX_PLAYERS; j++)
{
if(!IsPlayerLoggedIn(j))
continue;
if(pInfo[j][pTeam] == TEAM_OAMT && pInfo[j][pOamtBlitzerChat])
{
PlayerPlaySound(j, 1132, 0.0, 0.0, 0.0);
SendClientMessage(j, COLOR_ORANGE, Temp);
}
}
}
}
}
}
for(new i = 0; i < sizeof(pFarmField); i++)
{
if(IsPlayerInArea(playerid, pFarmField[i][farmFieldX], pFarmField[i][farmFieldY], pFarmField[i][farmFieldSecX], pFarmField[i][farmFieldSecY]))
{
if(VehicleID == pFarmVehicle[playerid][farmVehicleID])
{
if(IsTrailerAttachedToVehicle(VehicleID))
{
new vehicleTrailerID = GetVehicleTrailer(VehicleID);
if(GetVehicleModel(vehicleTrailerID) == 610 /* Farm Trailer */)
{
if(Final < 35 && Final > 15)
{
new Float:trailerPosX, Float:trailerPosY, Float:trailerPosZ;
GetVehiclePos(vehicleTrailerID, trailerPosX, trailerPosY, trailerPosZ);
CreateDynamicObject(855, trailerPosX, trailerPosY, trailerPosZ - 2.0, 0.0, 0.0, random(360));
}
}
}
}
}
}
}
else
{
KillTimer(pInfo[playerid][pTachoTimer]);
HideTachoForPlayer(playerid);
}
return 1;
}
Alles anzeigen
Guten Abend zusammen,
Ich habe das Problem das sich die Textdraws nicht setten wie es eingestellt ist weiß jemand wo das Problem liegt?