[HELP] Engine is already started.
#1

Needing some Help.

Hello, I've got a problem. I've already added cars into my script with the /engine command to start them.. But when added [FS] Carsystem by GermanReallife-Team, everything works fine except the /engine command.

Normally u have to do /engine as first to get your car started, but at the most cars on my script are already started and dont lose fuel (if i've got this cardealership filtership on). BUT if I typ 2 times /engine everything works normal again (losing fuel etc.) So question is, how to fix it? I want when people enter a car that they have to do /engine.


This is how my fuel command look likes, and this is the link to the Cardealership Script: http://forum.sa-mp.com/index.php?topic=78765.450 .

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
	  if(DynamicCars[GetPlayerVehicleID(playerid)-1][CarType] != 1)
		{
		  if(EngineStatus[GetPlayerVehicleID(playerid)] == 0)
			{
				SendClientMessage(playerid,COLOR_WHITE,"[Info:] Vehicle engine is not started (/engine)");
				TogglePlayerControllable(playerid,0);
			}
		}
	  if(DynamicCars[GetPlayerVehicleID(playerid)-1][FactionCar] != 255)
		{
		  if(DynamicFactions[DynamicCars[GetPlayerVehicleID(playerid)-1][FactionCar]][fType] == 1)
		  {
		    if(PlayerInfo[playerid][pFaction] != DynamicCars[GetPlayerVehicleID(playerid)-1][FactionCar])
		    {
					RemoveDriverFromVehicle(playerid);
		    }
		  }
		}
Can somone help me please, I'm confused.
Reply
#2

No1 knows what to do?
Reply
#3

Put under OnGameModeInIt:
Код:
EngineStatus[MAX_VEHICLES] = 0;
Reply
#4

Thanks, I'll give it a try :P
Reply
#5

Tried to place it but I'm getting this error: array index out of bounds (variable "EngineStatus").

This is what i've tried: (Isn't it already standing in my script?)

Код:
	for(new c=0;c<MAX_VEHICLES;c++)
	{
  		Fuel[c] = GasMax;
   		EngineStatus[MAX_VEHICLES] = 0;
		VehicleLocked[c] = 0;
		CarWindowStatus[c] = 1; //1 = up, 0 = down.
	}
and

Код:
	for(new c=0;c<MAX_VEHICLES;c++)
	{
    	EngineStatus[MAX_VEHICLES] = 0;
		Fuel[c] = GasMax;
   		EngineStatus[c] = 0;
		VehicleLocked[c] = 0;
		CarWindowStatus[c] = 1; //1 = up, 0 = down.
	}
This is the part standing below GameModeInit:

Код:
	for(new c=0;c<MAX_VEHICLES;c++)
	{
		Fuel[c] = GasMax;
   		EngineStatus[c] = 0;
		VehicleLocked[c] = 0;
		CarWindowStatus[c] = 1; //1 = up, 0 = down.
	}
I'm placing it on the wrong place?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)