[HELP] Engine is already started. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Engine is already started. (
/showthread.php?tid=107028)
[HELP] Engine is already started. -
ModernRP - 07.11.2009
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.
Re: [HELP] Engine is already started. -
ModernRP - 07.11.2009
No1 knows what to do?
Re: [HELP] Engine is already started. -
Blaze09 - 08.11.2009
Put under OnGameModeInIt:
Код:
EngineStatus[MAX_VEHICLES] = 0;
Re: [HELP] Engine is already started. -
ModernRP - 08.11.2009
Thanks, I'll give it a try :P
Re: [HELP] Engine is already started. -
ModernRP - 08.11.2009
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?