Hio,
ich hab ein Problem mit meinem Tank, es zieht sich kein Tank mehr ab!
Code:
checkgastimer = SetTimer("CheckGas", RunOutTime, 1);
public CheckGas()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAuto] == 1)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(i);
new Float: verbrauch = GetPlayerVehicleVerbrauch(i);
new tank = speedcount[i]/130;
if(GetVehicleModel(vehicle) == 481
|| GetVehicleModel(vehicle) == 509
|| GetVehicleModel(vehicle) == 510
|| IsAnEventCar(vehicle)) return 1;
if(IsANPCCar(vehicle)) return 1;
if(spawncar_gas[vehicle] > 1)
{
if(tank < 1)
{
spawncar_gas[vehicle] -= 0.1;
speedcount[i] = 0;
}
if(tank >= 1 && tank <= 20)
{
spawncar_gas[vehicle] -= verbrauch;
speedcount[i] = 0;
}
if(tank > 20 && tank <= 60)
{
spawncar_gas[vehicle] -= verbrauch*2;
speedcount[i] = 0;
}
if(tank > 60)
{
spawncar_gas[vehicle] -= verbrauch*3;
speedcount[i] = 0;
}
}
else
{
NoFuel[vehicle] = 1;
TogglePlayerControllable(i, 0);
PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
return 1;
}
}
}
}
}
return 0;
}
if(IsPlayerInAnyVehicle(i))
{
new kraftstoff[256], string_ftd[128];
kraftstoff = GetPlayerVehicleType(GetPlayerVehicleID(i));
format(string_ftd, sizeof(string_ftd), "~g~Kraftstoff: ~w~%s", kraftstoff);
TextDrawSetString(ftd[i], string_ftd);
new string_t[128];
format(string_t, sizeof(string_t), "~g~Tank: ~w~%.1f/%d", spawncar_gas[GetPlayerVehicleID(i)],spawncar_maxgas[GetPlayerVehicleID(i)]);
TextDrawSetString(fd[i], string_t);
TextDrawSetString(kd[i], "~g~KMH");
}
Hab glaub damals irgendwas geändert, weiss aber nicht mehr was...
Hoffe es kann einer helfen
LG
Moritz