SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 31/01/2010, 03:26 PM   #1
Justsmile
Huge Clucker
 
Join Date: Dec 2008
Posts: 211
Reputation: 0
Default One Player Bug.

Hey,

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

pawn Code:
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;
}
Justsmile is offline  
Old 31/01/2010, 03:52 PM   #2
ray187
Big Clucker
 
Join Date: Nov 2008
Posts: 196
Reputation: 0
Default Re: One Player Bug.

Jaja die Deutschen...

What do you mean with only one player gets the minus?
ray187 is offline  
Old 31/01/2010, 03:55 PM   #3
Justsmile
Huge Clucker
 
Join Date: Dec 2008
Posts: 211
Reputation: 0
Default Re: One Player Bug.

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
Justsmile is offline  
Old 31/01/2010, 03:59 PM   #4
ray187
Big Clucker
 
Join Date: Nov 2008
Posts: 196
Reputation: 0
Default Re: One Player Bug.

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.
ray187 is offline  
Old 31/01/2010, 04:02 PM   #5
Justsmile
Huge Clucker
 
Join Date: Dec 2008
Posts: 211
Reputation: 0
Default Re: One Player Bug.

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.
Justsmile is offline  
Old 31/01/2010, 04:09 PM   #6
ray187
Big Clucker
 
Join Date: Nov 2008
Posts: 196
Reputation: 0
Default Re: One Player Bug.

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?
ray187 is offline  
Old 31/01/2010, 04:10 PM   #7
Justsmile
Huge Clucker
 
Join Date: Dec 2008
Posts: 211
Reputation: 0
Default Re: One Player Bug.

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.
Justsmile is offline  
Old 31/01/2010, 04:10 PM   #8
MenaceX^
High-roller
 
Join Date: Aug 2008
Posts: 3,262
Reputation: 13
Default Re: One Player Bug.

Everything but Languages corner must be in English, stop mixing English and German or Dutch, can't understand what it is.
MenaceX^ is offline  
Old 31/01/2010, 04:13 PM   #9
ray187
Big Clucker
 
Join Date: Nov 2008
Posts: 196
Reputation: 0
Default Re: One Player Bug.

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.
ray187 is offline  
Old 31/01/2010, 04:16 PM   #10
ray187
Big Clucker
 
Join Date: Nov 2008
Posts: 196
Reputation: 0
Default Re: One Player Bug.

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?
ray187 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Add player/clan [tag] when player chooses class? fishnutslol Help Archive 7 08/07/2011 03:54 PM
Giving a Player money upon killing another player MrXavier Help Archive 2 04/11/2009 04:10 AM
How to disble player markers like dots? For certain player[FIXED] Kyle Help Archive 1 10/08/2009 03:58 PM
nedd help wit script that allows a player to teleport to another player figman Help Archive 6 11/04/2009 10:39 PM


All times are GMT. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.