2 questions
#1

Hi guys, how's it going?

Recently with some tests I noticed that my fuel system only works on first vehicle on server. It won't decrease on any other vehicle. I will gladly put all codes necessary.

pawn Код:
#undef MAX_VEHICLES
#define MAX_VEHICLES 500
public FuelAndSync()
{
    for(new i = 1; i <= MAX_VEHICLES; i++)
    {
        if (IsValidVehicle(i))
        {
            if(!IsABicikl(i)) // is not a bicycle
            {

                    if(VehInfo[i][Motor] == false) return 1; // engine
                    if(VehInfo[i][Gorivo] >= 0.60) // fuel
                    {
                        if(IsATruck(i)) { VehInfo[i][Gorivo] -= 0.40; }
                        else if(IsAOldCar(i)) { VehInfo[i][Gorivo] -= 0.40; } //
                                                 // ....
                    }
                    else
                    {
                        ToggleVehicleEngine(i);
                        VehInfo[i][Motor] = false;
                        VehInfo[i][NemaGoriva] = true;
                       
                        foreach (Player, j)
                        {
                            if(IsPlayerInVehicle(j, i) && GetPlayerState(j) == PLAYER_STATE_DRIVER)
                            {
                                SCM(j, COLOR_LIGHTRED, "Ostali ste bez goriva!");
                               
                            }
                        }
                    }
            }
        }
    }
And also I am wondering why my fuel shows e.g. 3.59 L when it should 3.60? Do I need to round it?
Reply


Messages In This Thread
2 questions - by Sime30 - 27.01.2015, 18:17
Re: 2 questions - by Sid_Alexander - 27.01.2015, 18:21
Re: 2 questions - by Sime30 - 27.01.2015, 18:23
Re: 2 questions - by Sime30 - 27.01.2015, 22:01
Re: 2 questions - by Jefff - 27.01.2015, 22:16
Re: 2 questions - by Sime30 - 27.01.2015, 22:22
Re: 2 questions - by Jefff - 27.01.2015, 22:23
Re: 2 questions - by Sime30 - 27.01.2015, 22:26
Re: 2 questions - by DobbysGamertag - 27.01.2015, 22:38
Re: 2 questions - by Jefff - 27.01.2015, 22:45

Forum Jump:


Users browsing this thread: 1 Guest(s)