Sziasztok.
Olyan problémám van, hogy a benzin csak akkor megy le ha valaki ül a kocsiban.
Na most én azt szeretném hogy ha nincsenek a kocsiban akkor is fogyjon a benzin ha jár a motor.
Szerintem itt kell ügyködni valamit de nem vagyok biztos benne ezért fordulok hozzátok.
public CheckGas()
{
new string[256];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(i);
if(Gas[vehicle] >= 1)
{
if(Gas[vehicle] <= 10)
{
PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
if(gGas == 0) {
GameTextForPlayer(i,\"~r~~n~~n~~n~~n~~n~~n~~n~~n~~n~!Kevés a benzin!\",5000,3);
}
}
if(gGas == 1) {
if(IsAPlane(vehicle) || IsABike(vehicle) || Postamotorok(vehicle) || Halaszhajo(vehicle) || IsASweeper(vehicle))
{
format(string, sizeof(string), \"~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Benzin:~w~ N/A\");
}
else
{
format(string, sizeof(string), \"~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Benzin:~w~ %d%\",Gas[vehicle]);
}
GameTextForPlayer(i,string,20500,3); }
if(IsAPlane(vehicle) || IsABike(vehicle) || Postamotorok(vehicle) || Halaszhajo(vehicle) || IsASweeper(vehicle) || engineOn[vehicle] == 0) { Gas[vehicle]++; }
Gas[vehicle]--;
}
else
{
NoFuel = 1;
TogglePlayerControllable(i, 0);
GameTextForPlayer(i,\"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Nincs benzin\",1500,3);
}
}
}
}
return 1;
}