Jump to content

[REZOLVAT] Probleme Benzina


SeNaToRuL.
 Share

Recommended Posts

Acum 6 minute, MiritaXD a spus:

task CheckGas[RunOutTime]() { new engine, lights, alarm, doors, bonnet, boot, objective; foreach(new i : Player) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) { new vehicle = GetPlayerVehicleID(i), query[128]; new spe = Carspeed(GetPlayerVehicleID(i)); if(Gas[vehicle] >= 1) { if(vehEngine[vehicle] == 1 && !IsPlayerPaused(i)) { if(noFuelVehicles(vehicle) || IsABoat(vehicle) || ExamCar == vehicle || JobVehicle == vehicle) { Gas[vehicle]++; } if(!IsPlayerPaused(i)) Gas[vehicle]--; new carid = FindSpawnID(vehicle); if(CarInfo[carid][cID] != 0 && carid != 0) { 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 `cars` SET `KM` = '%f' WHERE `ID` = '%d'", CarInfo[carid][KM], CarInfo[carid][cID]); mysql_tquery(SQL, query, "", ""); } } } } else if(!IsAFLYCar(vehicle)) { NoFuel = 1; 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 true; }


task CheckGas[RunOutTime]()
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
 
    foreach(new i : Player)
    {
        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
        {
            new vehicle = GetPlayerVehicleID(i), query[128];
            new spe = Carspeed(GetPlayerVehicleID(i));
 
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1 && !IsPlayerPaused(i))
                {
                    if(noFuelVehicles(vehicle) || IsABoat(vehicle) || ExamCar == vehicle || JobVehicle == vehicle)
                    {
                    	Gas[vehicle]++;
                    }
 
                    if(!IsPlayerPaused(i)) Gas[vehicle]--;
 
                    new carid = FindSpawnID(vehicle);
 
                    if(CarInfo[carid][cID] != 0 && carid != 0)
                    {
                        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 `cars` SET `KM` = '%f' WHERE `ID` = '%d'", CarInfo[carid][KM], CarInfo[carid][cID]);
                            mysql_tquery(SQL, query, "", "");
                        }
                    }
                }
            }
            else if(!IsAFLYCar(vehicle))
            {
                NoFuel = 1;

                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 true;
}

 

Asta e, iti multumesc foarte mult 😄

Link to comment
Share on other sites

Salut frate ma mai poti ajuta cu ceva?

Cand un player da /unrent la o masina inchiriata nu se baga la loc in stock...

 

YCMD:unrent(playerid, params[], help) {
    if(IsRentCar[playerid] != 0) { DestroyVehicle(VehicleRent[playerid]), VehicleRent[playerid] = 0, IsRentCar[playerid] = 0, GameTextForPlayer(playerid, "~w~Nu mai ai un vehicul inchiriat.", 5000, 3); }
    else return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai ai un vehicul inchiriat!");
    return true;
}

 

nustiu unde trebuie sa pun RentStock[playerid] ++

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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