Jump to content
Sign in to follow this  
Coucoul38

Check if className exists in config

Recommended Posts

I found this script to find the displayName form the className, but it doesn't seem to work with the mod Project RACS.

I'm taking the displayNames from a list, and I want it to not call this function if I put the configName in the list instead of the displayName.
So I want to check if the variable is actually the configName of a vehicle.

 

Here's what I have right now, but I'm new and I have no idea how to search in the config, so it doesn't work:

vehiclesList = ["M2A3","PRACS_M163_VADS"]; //Mix of displayName and configName
_vehicleDisplayName = vehiclesList select _playerScore;
	
//Check if the className is given
if(count(_vehicleDisplayName configClasses (configFile >> "cfgVehicles"))!=0) then { //this is not working
	_vehicleClassName = _vehicleDisplayName;
} else {
	_vehicleClassName = _vehicleDisplayName call fnc_g_findClassname;
}

 

Share this post


Link to post
Share on other sites

isClass is a command to get and would satisfy your requirements.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, POLPOX said:

isClass is a command to get and would satisfy your requirements.

Thanks, I got it to work perfectly 🤗

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×