Disabling all vehicles engine?
#1

Hi,

I need some help, I need to disable all vehicles that are being used with one command. What would be the fastest and the most efficient way to do that?

Thanks in advance.
Reply
#2

pawn Код:
for(new i=0;i<MAX_VEHICLES;i++)
{
     // your code
}
Reply
#3

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++)
{
     // your code
}
not really working, thanks tho.
Reply
#4

Vehicle IDs start at 1 and end at MAX_VEHICLES, not MAX_VEHICLES-1, so that loop is wrong. It should be:

pawn Код:
for(new i=1; i<=MAX_VEHICLES; i++)
Use SetVehicleParamsEx to set the engine state.
Reply
#5

... and make sure you have this function being called under OnGameModeInit():

pawn Код:
ManualVehicleEngineAndLights();
Reply
#6

https://sampwiki.blast.hk/wiki/GetVehicleParamsEx
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights

rep if i helped u!!!!! +++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)