SA-MP Forums Archive
Defaulting Vehicle Engine off - 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)
+--- Thread: Defaulting Vehicle Engine off (/showthread.php?tid=453871)



Defaulting Vehicle Engine off - industrialespionage - 26.07.2013

How would I be able to make it so that when a player enters any vehicle the engine is off and doesnt automatically turn on?


Re: Defaulting Vehicle Engine off - CrazyChoco - 26.07.2013

Simple, by using ManualVehicleEngineAndLights();

Example:
pawn Код:
public OnGameModeInit()
{
    ManualVehicleEngineAndLights();
}
Source: https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights


Re: Defaulting Vehicle Engine off - industrialespionage - 26.07.2013

Quote:
Originally Posted by CrazyChoco
Посмотреть сообщение
Simple, by using ManualVehicleEngineAndLights();

Example:
pawn Код:
public OnGameModeInit()
{
    ManualVehicleEngineAndLights();
}
Source: https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights
could i put that into the onfilterscriptinit callback?


Re: Defaulting Vehicle Engine off - CrazyChoco - 26.07.2013

Example:
pawn Код:
public OnFilterScriptInit()
{
    ManualVehicleEngineAndLights();
}



Re: Defaulting Vehicle Engine off - Konstantinos - 26.07.2013

Quote:
Originally Posted by industrialespionage
Посмотреть сообщение
could i put that into the onfilterscriptinit callback?
Quote:

Use this function before any player connects (OnGameModeInit) to tell all clients that the script will toggle the light and engine status by itself so that the vehicle doesn't start the engine when you enter it.

No, you cannot.


Re: Defaulting Vehicle Engine off - industrialespionage - 26.07.2013

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
No, you cannot.
it worked for me, so yeah you can, i just want it to be associated with the filterscript not the gamemmode itself


Re: Defaulting Vehicle Engine off - Konstantinos - 26.07.2013

Quote:
Originally Posted by industrialespionage
Посмотреть сообщение
it worked for me, so yeah you can, i just want it to be associated with the filterscript not the gamemmode itself
The reason, I'm telling you "no" is because in case you load or re-load a filterscript which includes this, then it will simply fail. It's better to use it to the main mode and be sure.


Re: Defaulting Vehicle Engine off - industrialespionage - 26.07.2013

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
No, you cannot.
also how would I be able to get the number of max vehicles on my server?! so I can reference them via an id for example like:

new VehicleArray[MAX_VEHICLES];

I tried looking for a function but couldnt find one.


Re: Defaulting Vehicle Engine off - Konstantinos - 26.07.2013

It's defined in a_samp.inc
pawn Код:
#define MAX_VEHICLES                            (2000)