All pastes #959398 Raw Edit

andre fuel system

public text v1 · immutable
#959398 ·published 2008-03-27 12:42 UTC
rendered paste body
//this is andre fuel system....

public LoseFuel()
{
	new string[256];
	for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
	{
	    if(IsPlayerInAnyVehicle(playerid)) // of course, it won't get the VehGas down, when player ins't in a vehicle
	    {
		    new PlayerVehicle = GetPlayerVehicleID(playerid);
		    VehGas[PlayerVehicle] -= 1;
		    if(VehGas[PlayerVehicle] == 30 || VehGas[PlayerVehicle] == 20 || VehGas[PlayerVehicle] == 10)
		    {
		        format(string, sizeof(string), "* Warning! some message... ");
		        SendClientMessage(playerid, COLOR_RED, string);
			}
			else if(VehGas[PlayerVehicle] == 0)
		    {
			    format(string, sizeof(string), "* Fuel is over, type /exit to exit from vehicle", vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
			    SendClientMessage(playerid, COLOR_RED, string);
			    TogglePlayerControllable(playerid, 0);
			}
		}
	}
}