Defaulting Vehicle Engine off
#1

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?
Reply
#2

Simple, by using ManualVehicleEngineAndLights();

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

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?
Reply
#4

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

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.
Reply
#6

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
Reply
#7

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.
Reply
#8

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.
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)