Jump to content

Question

1 answer to this question

Recommended Posts

Posted

Pune:

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(GetPlayerMoney(i) >= FillUp+4)
				{
					Gas[VID] += FillUp;
					FillUp = FillUp * SBizzInfo[3][sbEntranceCost];
				    format(string,sizeof(string),"* Vehicle filled up, for: $%d.",FillUp);
				    SendClientMessage(i,COLOR_LIGHTBLUE,string);
					GivePlayerMoney(i, - FillUp);
					SBizzInfo[3][sbTill] += FillUp;
					ExtortionSBiz(3, FillUp);
					Refueling[i] = 0;
				}
			   	else
			   	{
			   	    format(string,sizeof(string),"* Not enough Money to refill, it costs $%d to fill your Vehicle.",FillUp);
				    SendClientMessage(i,COLOR_LIGHTBLUE,string);
			   	}
		 	}
		}
	}
	return 1;
}
if(strcmp(cmd, "/fill", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(IsAtGasStation(playerid))
			{
			    if(Gas[idcar] <= 99)
			    {
			    	TogglePlayerControllable(playerid, 0);
			    	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
				{
				    GameTextForPlayer(playerid,"~r~~n~~n~~n~~n~~n~~n~~n~~n~~n~Gas can is full",2000,3);
				}
			}
			else
			{
				SendClientMessage(playerid,COLOR_GREY,"   You're not at a Gas Station!");
			}
		}
    	return 1;
	}
forward Fillup();

LISTA - GAMEMODE-URI SA-MP - Le gasiti pe toate aici: http://twiriock.com/3MGP

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.