One Player Bug.
#1

Hey,

only one Player get the minus of "Tank", why?

pawn Код:
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 Float: verbrauch = GetPlayerVehicleVerbrauch(i);
                new tank = speedcount[i]/130;
                if(vehicle >= bike1 && vehicle <= bike3) return 1;
            if(spawncar_gas[vehicle] > 1)
            {
                if(tank < 1)
                {
                        spawncar_gas[vehicle] -= 0.1;
                        format(string, sizeof(string), "~r~Tank: %.1f/%d", spawncar_gas[vehicle], spawncar_maxgas[vehicle]);
                        TextDrawSetString(fd[i], string);
                        speedcount[i] = 0;
                        return 1;
                    }
                    if(tank >= 1 && tank <= 20)
              {
                        spawncar_gas[vehicle] -= verbrauch;
                        format(string, sizeof(string), "~r~Tank: %.1f/%d", spawncar_gas[vehicle], spawncar_maxgas[vehicle]);
                        TextDrawSetString(fd[i], string);
                        speedcount[i] = 0;
                        return 1;
                    }
                    if(tank > 20 && tank <= 60)
                    {
                        spawncar_gas[vehicle] -= verbrauch*2;
                        format(string, sizeof(string), "~r~Tank: %.1f/%d", spawncar_gas[vehicle], spawncar_maxgas[vehicle]);
                        TextDrawSetString(fd[i], string);
                        speedcount[i] = 0;
                        return 1;
                    }
                    if(tank > 60)
                    {
                        spawncar_gas[vehicle] -= verbrauch*3;
                        format(string, sizeof(string), "~r~Tank: %.1f/%d", spawncar_gas[vehicle], spawncar_maxgas[vehicle]);
                        TextDrawSetString(fd[i], string);
                        speedcount[i] = 0;
                        return 1;
                    }
                }
                else
                {
                  NoFuel[vehicle] = 1;
                  RemovePlayerFromVehicle(i);
          PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
          return 1;
            }
            }
        }
    }
    return 1;
}
Reply
#2

Jaja die Deutschen...

What do you mean with only one player gets the minus?
Reply
#3

Ja, nur die Person die als erstes / als einzigstes im Auto ist wird abgezogen und angezeigt. Bei anderen wiirds abgeozegen aber nicht angezeigt

Only the person who gets first in / only one in get lower fuel and will be correctly displayed, But at the others not correctly displaid
Reply
#4

Jo gilt nur fьr die Personen die Fahrer sind. Siehe if-statement "if(GetPlayerState(i) == PLAYER_STATE_DRIVER)"

Yeah applies only for the driver of the vehicle.
Reply
#5

ich weiЯ aber es sind alle im Vehicle, der Textdraw wird aber nur fьr eine Person aktualisiert. jeder player hat einen eiogenen Textdraw.

know but they are all in the vehicle, the textdraw it's not updated for one person. each player has a eiogenen textdraw.
Reply
#6

Willst du, dass der Textdraw fьr alle im Auto angezeigt wird oder was genau ?


Do you wanna show the textdraw to everyone in the car?
Reply
#7

Nein, nur fьr den Fahrer, der Textdraw wird angezeigt, aber er wird nicht geuьpdatet, nur fьr einen Spieler.

No, only for the driver who textdraw appears, but he will not geuьpdatet, except for one player.
Reply
#8

Everything but Languages corner must be in English, stop mixing English and German or Dutch, can't understand what it is.
Reply
#9

Quote:

Everything but Languages corner must be in English, stop mixing English and German or Dutch, can't understand what it is.

Shush boy. As you can see every line is translated below.
Reply
#10

Sry, steh grad aufm Schlauch... ich check dein Problem nicht. Der Textdraw wird nur fьr den ersten Fahrer angezeigt und die restlichen Fahrer sehen ihn nicht?

Sry, am a bit confused and don`t get your problem. The textdraw only gets displayed for the first driver while the others don`t see it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)