Jump to content

[REZOLVAT] Problema timp in clan/fuel la moto


Nigga
 Share

Recommended Posts

 

function CheckGas()
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    foreach(new i : Player)
    {
        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
        {
            new vehicle = GetPlayerVehicleID(i), query[128];
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1)
                {
                    if(IsAPlane(vehicle) || IsABoat(vehicle) || ExamCar[i] == vehicle || JobVehicle[i] == vehicle) { Gas[vehicle]++; }
                    if(!IsPlayerPaused(i)) Gas[vehicle]--;
                    new carid = FindSpawnID(vehicle);
                    if(CarInfo[carid][cID] != -2 && carid != 0)
                    {
                        new spe = Carspeed(i);
                        if(spe > 5 && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(i) == vehicle && !IsPlayerPaused(i))
                        {
                            CarInfo[carid][KM] += (spe * 0.27) / 100;
                            mysql_format(SQL, query, sizeof query, "UPDATE `server_players_cars` SET `KM` = '%f' WHERE `ID` = '%d'", CarInfo[carid][KM], carid);
                            mysql_tquery(SQL, query, "", "");
                        }
                    }
                }
            }
            else if(!IsAFLYCar(vehicle))
            {
                NoFuel[i] = 1;
                TogglePlayerControllable(i, 0);
                GameTextForPlayer(i, "Fara benzina", 1500, 3);
                vehEngine[vehicle] = 0;
                GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicle, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
                SetPVarInt(i, "Engine", 0);
            }
        }
    }
    return 1;
}
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...