Hallo Community
Vieleicht könnt ihr mir helfen.
Ich möchte gerne es so haben das der tank auch alle geht wenn der motor an ist aber keiner drin sitzt
was muss ich löschen??
Code
public CheckGas()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
new vehicle = GetPlayerVehicleID(i);
new Model = GetVehicleModel(GetPlayerVehicleID(i));
if(Gas[vehicle] >= 1)
{
if(IsAPlane(vehicle) || IsABoat(vehicle) || Model == 462 || Model == 481)
{
Gas[vehicle]++;
}
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(i);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
if(vid != INVALID_VEHICLE_ID)
{
if(engine == VEHICLE_PARAMS_ON)
{
if(SupCar[i] != 999)
{
Gas[vehicle] = GetGasMax(GetVehicleModel(vehicle));
}
Gas[vehicle]--;
}
}
}
else
{
NoFuel[i] = 1;
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(i);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~Kein Benzin mehr~n~Gib /exit zum ausgestiegen ein",1500,3);
}
if(Gas[vehicle] > GetGasMax(GetVehicleModel(vehicle)))
{
Gas[vehicle] = GetGasMax(GetVehicleModel(vehicle));
}
}
return 1;
}
Alles anzeigen