Detecting a /v car.
#5

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
Код:
new bool:VehiclesByVCommand[2000];

// In your /v command use:
VehiclesByVCommand[vehicleid] = true;
After that, you could have a command that destroys all vehicles created by /v.
Just loop through all vehicles (from 1 to 1999) and check if the VehicleByVCommand is set to "true".
If it's "true", destroy the vehicle and set this variable back to "false" (to prevent trying to destroy the vehicle again if the command is used again afterwards).
If it's false, do nothing.
Why are you using 2000 instead of MAX_VEHICLES? I know MAX_VEHICLES is equals to 2000, but sometimes scripters does not use all of it, so they do is re-define MAX_VEHICLES and change its size, I'm not insulting you in anyway it's just my opinion that using MAX_VEHICLES is much better so if you loop VehiclesByVCommand using (sizeof VehiclesByVCommand) of course, the loop will continue until 2000 instead of the new size you just redefined.
Reply


Messages In This Thread
Detecting a /v car. - by DaniceMcHarley - 06.01.2014, 15:42
Re: Detecting a /v car. - by PowerPC603 - 06.01.2014, 16:01
Re: Detecting a /v car. - by sammp - 06.01.2014, 16:05
Re: Detecting a /v car. - by sammp - 06.01.2014, 16:24
Re: Detecting a /v car. - by Patrick - 06.01.2014, 16:29
Re: Detecting a /v car. - by Konstantinos - 06.01.2014, 16:34
Re: Detecting a /v car. - by DaniceMcHarley - 06.01.2014, 17:39
Re: Detecting a /v car. - by PowerPC603 - 07.01.2014, 12:58
Re: Detecting a /v car. - by Konstantinos - 07.01.2014, 15:08
Re: Detecting a /v car. - by PowerPC603 - 07.01.2014, 15:19

Forum Jump:


Users browsing this thread: 2 Guest(s)