Jump to content
  • 0

Problema sistem de fuel


Question

Posted

Am si eu o problema.....cand ma duc la o benzinarie sa alimentez vehiculul scriu: /fill si scrie Asteapta putin vehiculul se alimenteaza. Dupa ce termina imi ia bani dar tot nam benzina in masina insa daca scriu: /fuelcars la fel....ma puteti ajuta?

Vrei ceva? [email protected]

11 answers to this question

Recommended Posts

Posted

Comanda Fill:

	if(strcmp(cmd, "/fill", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(IsAtGasStation(playerid))
			{
			    GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Re-Fueling Vehicle, please wait",2000,3);
				SetTimer("Fillup",RefuelWait,0);
				Refueling[playerid] = 1;
			}
			else
			{
				SendClientMessage(playerid,COLOR_GREY,"   You're not at a Gas Station!");
			}
		}
    	return 1;
	}
Comanda FuelCars:
	if(strcmp(cmd, "/fuelcars", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 3)
	        {
	            for(new c=0;c<CAR_AMOUNT;c++)
				{
					Gas[c] = GasMax;
				}
				SendClientMessage(playerid, COLOR_GREY, "   All cars filled with Fuel ! ");
	        }
	        else
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You are not an Admin ! ");
	            return 1;
	        }
	    }
	    return 1;
	}

Vrei ceva? [email protected]

Posted

Ciudat ai deja functia care alimenteaza automat masina

Refueling[playerid] = 1;

Cred ca problema la tine e la /fuel ca nu iti arata corect sau ce speedometer,fuel system ai? il poti arata (comanda /fuel)

Posted

Am schimbat speedo am bagat vreo 3 dar degeaba nusar putea sa fie la public Fillup?

public Fillup:

public Fillup()
{
	for(new i=0; i<MAX_PLAYERS; i++)
   	{
	   	if(IsPlayerConnected(i))
	   	{
		    new VID;
		    new FillUp;
		    new string[256];
		    VID = GetPlayerVehicleID(i);
		    FillUp = GasMax - Gas[VID];
			if(Refueling[i] == 1)
		    {
		        if(IsACopCar(VID) || IsAnFbiCar(VID) || IsAnAmbulance(VID) || IsNgCar(VID) || IsAGovernmentCar(VID) || IsAHspdCar(VID))
		        {
		            Gas[VID] += FillUp;
		            FillUp = FillUp * 10;
		            format(string,sizeof(string),"* Vehicle filled up, for: $%s.",number_format(FillUp));
	    			SendClientMessage(i,COLOR_LIGHTBLUE,string);
	    			GameTextForPlayer(i, "~w~Government has paid for a gas.", 5000, 1);
					SBizzInfo[3][sbTill] += FillUp;
					ExtortionSBiz(3, FillUp);
					Refueling[i] = 0;
					TogglePlayerControllable(i, 1);
		        }
		        else
		        {
					if(GetPlayerCash(i) >= FillUp+4)
					{
						Gas[VID] += FillUp;
						FillUp = FillUp * 10;
				    	format(string,sizeof(string),"* Vehicle filled up, for: $%s.",number_format(FillUp));
				    	SendClientMessage(i,COLOR_LIGHTBLUE,string);
						GivePlayerCash(i, - FillUp);
						SBizzInfo[3][sbTill] += FillUp;
						ExtortionSBiz(3, FillUp);
						Refueling[i] = 0;
						TogglePlayerControllable(i, 1);
					}
			   		else
			   		{
			   	    	format(string,sizeof(string),"* Not enough Money to refill, it costs $%s to fill your Vehicle.",number_format(FillUp));
				    	SendClientMessage(i,COLOR_LIGHTBLUE,string);
				    	TogglePlayerControllable(i, 1);
			   		}
				}
		 	}
		}
	}
	return 1;
}
Comanda fuel:
	if(strcmp(cmd, "/fuel", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (gGas[playerid] == 0)
			{
				gGas[playerid] = 1;
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Fuel Info on", 5000, 5);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
			}
			else if (gGas[playerid] == 1)
			{
				gGas[playerid] = 0;
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~r~Fuel Info off", 5000, 5);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
			}
		}
		return 1;
	}

Vrei ceva? [email protected]

Posted
public Fillup()
{
	for(new i=0; i<MAX_PLAYERS; i++)
   	{
	   	if(IsPlayerConnected(i))
	   	{
		    new VID;
		    new FillUp;
		    new string[256];
		    VID = GetPlayerVehicleID(i);
		    FillUp = GasMax - Gas[VID];
			if(Refueling[i] == 1)
		    {
		        if(IsACopCar(VID) || IsAnFbiCar(VID) || IsAnAmbulance(VID) || IsNgCar(VID) || IsAGovernmentCar(VID) || IsAHspdCar(VID))
		        {
		            Gas[VID] += FillUp;
		            FillUp = FillUp * 10;
		            format(string,sizeof(string),"* Vehicle filled up, for: $%s.",number_format(FillUp));
	    			SendClientMessage(i,COLOR_LIGHTBLUE,string);
	    			GameTextForPlayer(i, "~w~Government has paid for a gas.", 5000, 1);
					SBizzInfo[3][sbTill] += FillUp;
					ExtortionSBiz(3, FillUp);
					Refueling[i] = 1;
					TogglePlayerControllable(i, 1);
		        }
		        else
		        {
					if(GetPlayerCash(i) >= FillUp+4)
					{
						Gas[VID] += FillUp;
						FillUp = FillUp * 10;
				    	format(string,sizeof(string),"* Vehicle filled up, for: $%s.",number_format(FillUp));
				    	SendClientMessage(i,COLOR_LIGHTBLUE,string);
						GivePlayerCash(i, - FillUp);
						SBizzInfo[3][sbTill] += FillUp;
						ExtortionSBiz(3, FillUp);
						Refueling[i] = 1;
						TogglePlayerControllable(i, 1);
					}
			   		else
			   		{
			   	    	format(string,sizeof(string),"* Not enough Money to refill, it costs $%s to fill your Vehicle.",number_format(FillUp));
				    	SendClientMessage(i,COLOR_LIGHTBLUE,string);
				    	TogglePlayerControllable(i, 1);
			   		}
				}
		 	}
		}
	}
	return 1;
}

Posted

Incearca asa:

public Fillup()
{
	for(new i=0; i<MAX_PLAYERS; i++)
   	{
	   	if(IsPlayerConnected(i))
	   	{
		    new VID;
		    new FillUp;
		    new string[256];
		    VID = GetPlayerVehicleID(i);
		    FillUp = GasMax - Gas[VID];
			if(Refueling[i] == 1)
		    {
		        if(IsACopCar(VID) || IsAnFbiCar(VID) || IsAnAmbulance(VID) || IsNgCar(VID) || IsAGovernmentCar(VID) || IsAHspdCar(VID))
		        {
		            Gas[VID] += FillUp;
		            FillUp = FillUp * 10;
		            format(string,sizeof(string),"* Vehicle filled up, for: $%s.",number_format(FillUp));
	    			SendClientMessage(i,COLOR_LIGHTBLUE,string);
	    			GameTextForPlayer(i, "~w~Government has paid for a gas.", 5000, 1);
					SBizzInfo[3][sbTill] += FillUp;
					ExtortionSBiz(3, FillUp);
					Refueling[i] = 0;
					TogglePlayerControllable(i, 1);
		        }
		        else
		        {
					if(GetPlayerCash(i) >= FillUp+4)
					{
						Gas[VID] += FillUp;
						FillUp = FillUp * 10;
				    	format(string,sizeof(string),"* Vehicle filled up, for: $%s.",number_format(FillUp));
				    	SendClientMessage(i,COLOR_LIGHTBLUE,string);
						GivePlayerCash(i, - FillUp);
						SBizzInfo[3][sbTill] += FillUp;
						ExtortionSBiz(3, FillUp);
						Refueling[i] = 1;
						TogglePlayerControllable(i, 1);
					}
			   		else
			   		{
			   	    	format(string,sizeof(string),"* Not enough Money to refill, it costs $%s to fill your Vehicle.",number_format(FillUp));
				    	SendClientMessage(i,COLOR_LIGHTBLUE,string);
				    	TogglePlayerControllable(i, 1);
			   		}
				}
		 	}
		}
	}
	return 1;
}

Posted

Mea zis cineva sa bag o comanda care verifica cata benzina mai e in vehicul ok am bagato si de fiecare data zicea 100%

Comanda:

    if ( strcmp ( cmdtext, "/verificabenzina", true ) == 0 )
    {
    new text [ 300 ];
    format ( text, sizeof ( text ), "Benzia ta: %d", Gas ) ;
    SendClientMessage ( playerid, -1, text  );
    return 1;
    }

Vrei ceva? [email protected]

Posted

Posteaza astea:

#define GasMax 100
#define RunOutTime 25000
#define RefuelWait 5000

#define CAR_AMOUNT 700 //Change to Your Vehicle Amount
new Gas[CAR_AMOUNT];

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.