Engine
#1

I have these scripts:

Engine:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  new VID = GetPlayerVehicleID(playerid);
  new MOD = GetVehicleModel(playerid);
  new string[128];
  
  if(newstate == PLAYER_STATE_DRIVER)
	{
	  format(string, sizeof(string), "~g~%s",VehicleTittle[GetVehicleModel(VID)-400]);
	  GameTextForPlayer(playerid,string,3500,1);
		if(VehicleStarted[VID] == 0 && MOD != 510 && MOD != 509 && MOD != 481)
		{
			TogglePlayerControllable(playerid,0);
			SendClientMessage(playerid,WHITE,"* This Vehicle is not Started yet. You can start it with key: 'TAB'");
		}
		else
		{
			SendClientMessage(playerid,YELLOW,"* This Vehicle is already started!");
		}
		if(VehicleGas[VID] < 1)
		{
			SendClientMessage(playerid,WHITE,"* No fuel in Vehicle!");
		}
	}
	return 1;
}
Код:
public FuelUpdate()
{
	new string[256];
	for(new i=0;i<MAX_PLAYERS;i++)
	{
	  new VID = GetPlayerVehicleID(i);
		new MOD = GetVehicleModel(i);
		if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
		{
			if(IsPlayerConnected(i))
			{
				if(Filling[i] == 0 && VehicleStarted[VID] == 1 && MOD != 510 && MOD != 509 && MOD != 481)
				{
					if(VehicleGas[VID] >= 1)
					{
						VehicleGas[VID] -= 1;
						format(string, sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~~l~~p~FUEL: ~w~%d%",VehicleGas[VID]);
						GameTextForPlayer(i,string,11500,3);
					}
					else
					{
						TogglePlayerControllable(i,0);
						GameTextForPlayer(i,"~n~~n~~n~~n~~b~Your car is without fuel!",2500,3);
						SendClientMessage(i,WHITE,"* Your Vehicle is without Gas! Use '/exit' to get out.");
					}
				}
			}
		}
	}
	return 1;
}
But Gas and Fuel Update keep showing for bikes, what's wrong?
Reply
#2

Help?
Reply
#3

idk Well.. Check this
Код:
if(VehicleStarted[VID] == 0 && MOD != 510 && MOD != 509 && MOD != 481)
Change car ids
Reply
#4

Already checked, idk why this problem keep happening! Help please!

sorry bad english.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)