Hallo,
Ich habe ein Problem ,undzwar wenn ich mein Motor ausschalte steigt der Tank, wieso?
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);
new Model = GetVehicleModel(GetPlayerVehicleID(i));
if(Gas[vehicle] >= 1)
{
if(Gas[vehicle] <= 10) { PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0); }
if(gGas[i] == 1) {
format(string, sizeof(string), "~r~~n~~n~~n~~n~~n~~n~~n~~n~~n~Benzin:~w~ %d%",Gas[vehicle]);
GameTextForPlayer(i,string,15500,3); }
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)
{
Gas[vehicle]--;
}
}
}
else
{
NoFuel[i] = 1;
FreezePlayer(i);
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;
}
Würde mich freuen wenn mir jemand helfen würde.
//edit code unterienander geschrieben (in pwn funktioniert das irgendwie nicht)