Disabling all vehicles engine? - 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: Disabling all vehicles engine? (
/showthread.php?tid=496387)
Disabling all vehicles engine? -
XrespenserX - 21.02.2014
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.
Re: Disabling all vehicles engine? -
Jimmy0wns - 21.02.2014
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++)
{
// your code
}
AW: Re: Disabling all vehicles engine? -
XrespenserX - 21.02.2014
Quote:
Originally Posted by Jimmy0wns
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++) { // your code }
|
not really working, thanks tho.
Re: Disabling all vehicles engine? -
MP2 - 21.02.2014
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.
Re: Disabling all vehicles engine? -
Scenario - 21.02.2014
... and make sure you have this function being called under OnGameModeInit():
pawn Код:
ManualVehicleEngineAndLights();
Re: Disabling all vehicles engine? -
Snipa - 17.03.2014
https://sampwiki.blast.hk/wiki/GetVehicleParamsEx
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights
rep if i helped u!!!!! +++