Home   Help Search Login Register  

Author Topic: Addon check  (Read 1054 times)

0 Members and 1 Guest are viewing this topic.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Addon check
« on: 19 Aug 2008, 18:14:41 »
Is there any way in a script to have like

Code: [Select]
if (HasAddon _X) do {stuff}
to see so whether or not to spawn a required addon vehicle or not?

Luke
Pesky Human!!
Wort Wort Wort.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Addon check
« Reply #1 on: 19 Aug 2008, 18:38:33 »
Code: [Select]
if (isClass (configFile >> "YourCfg" >> "YOUR_addon")) then {do stuff};
"YourCfg" = the config you're checking in. In your case, it'd be "CfgVehicles".

"YOUR_addon" = the class name of the vehicle (same you'd use in createVehicle).

Good luck.  :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"