Jump to content
Sign in to follow this  
SeNaToRuL.

Probleme Benzina

Recommended Posts

Salut, utilizez gamemode burned si cand ma urc pe o bicicleta ii scade motorina.. ma puteti ajuta va rog?

Script: 

function Checkvehinfo(i) {
    if(GetPlayerState(i) == PLAYER_STATE_DRIVER && InDealer == 0) {

        new 
            str2[10], km[60], fuel[50],
            engine,lights,alarm,doors,bonnet,boot,objective,
            vehicle = GetPlayerVehicleID(i), spe = Carspeed(GetPlayerVehicleID(i)), carid = FindSpawnID(vehicle);
            
        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);

        if(!PlayerInfo[pHudGen])
            return true;

        gString[0] = EOS;
        format(str2, sizeof(str2), "%s%d", spe < 100 ? ("~g~") : spe >= 150 ? ("~r~") : ("~y~"), spe);
        PlayerTextDrawSetString(i, SpeedometerPTD[0], str2);
        if(carid != 0) format(km, sizeof(km), "~n~odomter: %.2f", CarInfo[carid][KM]);
        if(!IsABike(vehicle) && !IsAPlane(vehicle)) format(fuel, sizeof(fuel), "~n~fuel: %s%d~w~~h~ (c: %dl)", Gas[vehicle] > 60 ? ("~g~") : Gas[vehicle] <= 30 ? ("~r~") : ("~y~"), Gas[vehicle], GetVehicleConsum(spe));
        format(gString, 120, "doors: %s~w~~h~%s%s", doors != 1 ? ("~g~unlocked") : ("~r~locked"), fuel, km);
        if(InExamen) format(gString, 150, "%s~n~Checkpoints: ~r~%d/17", gString, CP-100);
        PlayerTextDrawSetString(i, SpeedometerPTD[2], gString);
    }
    return true;
}

Share this post


Link to post
Share on other sites
Acum 58 minute, SeNaToRuL. a spus:

Salut, utilizez gamemode burned si cand ma urc pe o bicicleta ii scade motorina.. ma puteti ajuta va rog?

Script: 

function Checkvehinfo(i) {
    if(GetPlayerState(i) == PLAYER_STATE_DRIVER && InDealer == 0) {

        new 
            str2[10], km[60], fuel[50],
            engine,lights,alarm,doors,bonnet,boot,objective,
            vehicle = GetPlayerVehicleID(i), spe = Carspeed(GetPlayerVehicleID(i)), carid = FindSpawnID(vehicle);
            
        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);

        if(!PlayerInfo[pHudGen])
            return true;

        gString[0] = EOS;
        format(str2, sizeof(str2), "%s%d", spe < 100 ? ("~g~") : spe >= 150 ? ("~r~") : ("~y~"), spe);
        PlayerTextDrawSetString(i, SpeedometerPTD[0], str2);
        if(carid != 0) format(km, sizeof(km), "~n~odomter: %.2f", CarInfo[carid][KM]);
        if(!IsABike(vehicle) && !IsAPlane(vehicle)) format(fuel, sizeof(fuel), "~n~fuel: %s%d~w~~h~ (c: %dl)", Gas[vehicle] > 60 ? ("~g~") : Gas[vehicle] <= 30 ? ("~r~") : ("~y~"), Gas[vehicle], GetVehicleConsum(spe));
        format(gString, 120, "doors: %s~w~~h~%s%s", doors != 1 ? ("~g~unlocked") : ("~r~locked"), fuel, km);
        if(InExamen) format(gString, 150, "%s~n~Checkpoints: ~r~%d/17", gString, CP-100);
        PlayerTextDrawSetString(i, SpeedometerPTD[2], gString);
    }
    return true;
}

nu pare sa fie aici problema, functia se numea checkgas sau ceva de genu'

Share this post


Link to post
Share on other sites
1 oră în urmă, MiritaXD a spus:

nu pare sa fie aici problema, functia se numea checkgas sau ceva de genu'

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];
 
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1)
                {
                    if(IsAPlane(vehicle) || IsABoat(vehicle) || IsABike(vehicle) || ExamCar == vehicle || JobVehicle == vehicle) { Gas[vehicle]++; }
 
                    if(!IsPlayerPaused(i)) Gas[vehicle]--;
 
                    new carid = FindSpawnID(vehicle);
 
                    if(CarInfo[carid][cID] != 0 && carid != 0)
                    {
                        new spe = Carspeed(GetPlayerVehicleID(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 `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;
}

Share this post


Link to post
Share on other sites
Acum 50 minute, SeNaToRuL. 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];
 
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1)
                {
                    if(IsAPlane(vehicle) || IsABoat(vehicle) || IsABike(vehicle) || ExamCar == vehicle || JobVehicle == vehicle) { Gas[vehicle]++; }
 
                    if(!IsPlayerPaused(i)) Gas[vehicle]--;
 
                    new carid = FindSpawnID(vehicle);
 
                    if(CarInfo[carid][cID] != 0 && carid != 0)
                    {
                        new spe = Carspeed(GetPlayerVehicleID(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 `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;
}

function noFuelVehicles(vehicleid)
{
	switch (GetVehicleModel(vehicleid))
	{
		case 481, 509, 510, 460, 476, 511, 512, 513, 519, 520, 553, 577, 592, 593: return 1;
	}
	return 0;
}

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];
 
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1)
                {
                    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)
                    {
                        new spe = Carspeed(GetPlayerVehicleID(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 `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;
}

 

Incearca asa

Share this post


Link to post
Share on other sites
Acum 10 minute, MiritaXD a spus:

function noFuelVehicles(vehicleid) { switch (GetVehicleModel(vehicleid)) { case 481, 509, 510, 460, 476, 511, 512, 513, 519, 520, 553, 577, 592, 593: return 1; } return 0; } 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]; if(Gas[vehicle] >= 1) { if(vehEngine[vehicle] == 1) { 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) { new spe = Carspeed(GetPlayerVehicleID(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 `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; }

function noFuelVehicles(vehicleid)
{
	switch (GetVehicleModel(vehicleid))
	{
		case 481, 509, 510, 460, 476, 511, 512, 513, 519, 520, 553, 577, 592, 593: return 1;
	}
	return 0;
}

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];
 
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1)
                {
                    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)
                    {
                        new spe = Carspeed(GetPlayerVehicleID(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 `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;
}

 

Incearca asa

Nu mai scade dar gen am observat ca daca ma pun afk, si dupa ma intorc pe server creste.. gen am stat putin afk o ajuns la 106

Share this post


Link to post
Share on other sites
Acum 5 minute, SeNaToRuL. a spus:

Nu mai scade dar gen am observat ca daca ma pun afk, si dupa ma intorc pe server creste.. gen am stat putin afk o ajuns la 106

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(spe < 1)
            	return true;
 
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1)
                {
                    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;
}

 

Share this post


Link to post
Share on other sites
Acum 3 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(spe < 1) return true; if(Gas[vehicle] >= 1) { if(vehEngine[vehicle] == 1) { 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(spe < 1)
            	return true;
 
            if(Gas[vehicle] >= 1)
            {
                if(vehEngine[vehicle] == 1)
                {
                    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;
}

 

tot la fel

Share this post


Link to post
Share on other sites
Acum 5 minute, SeNaToRuL. a spus:

tot la fel

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 && !IsPlayerPaused(i))
            {
                if(vehEngine[vehicle] == 1)
                {
                    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;
}

 

Share this post


Link to post
Share on other sites
Acum 11 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 && !IsPlayerPaused(i)) { if(vehEngine[vehicle] == 1) { 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 && !IsPlayerPaused(i))
            {
                if(vehEngine[vehicle] == 1)
                {
                    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;
}

 

Acuma cand ma pun afk si intru iar imi da ca sunt fara benzina si nu mai merge

Share this post


Link to post
Share on other sites
Acum 16 minute, SeNaToRuL. a spus:

Acuma cand ma pun afk si intru iar imi da ca sunt fara benzina si nu mai merge

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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...