Author Topic: Checking to see if an add-on is present  (Read 461 times)

Code: [Select]
%error = forceRequiredAddOn("player_no_jet");

if(%error)
{
if(%error == $error::addOn_disabled)
{
playerNoJet.uiName = "";
}

if(%error == $error::addOn_notFound)
{
return;
}
}

That's the code from CityRP. The only problem is, I need to check if IGSO is present, otherwise just ignore something. That code above will force it, which I don't want.

Or wait, can I use that and have my code within "if(!%error)"?

So what it really means is that it's not going to force it, just see if it's there then take if from there?

if(isFile("Add-Ons/Script_IGSO.zip"))

or

if($AddOn__Script_IGSO)

?

if(isFile("Add-Ons/Script_IGSO.zip"))

or

if($AddOn__Script_IGSO)

?
Oh, could've done that!

Ashame that I happened to use that myself in the same file.
« Last Edit: March 07, 2009, 12:52:49 PM by Kalphiter »