Jump to content
  • 0

Problema sistem de fuel


Slipknot

Question

11 answers to this question

Recommended Posts

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.