Optional VPhysics extension
I don't know what I'm doing. Nothing works. I want to make the VPhysics extension optional since the plugin is only using "Phys_ApplyTorqueCenter" native.
Trying to make the plugin compile with or without the vphysics.inc (so it can be downloaded from the forum without extra requirements) and have the plugin run with or without the VPhysics extension being installed. Am I blind? I don't see how to detect if the extension is running, something like RegPluginLibrary. Since theres no way to determine if the extension is running I'm blindly calling Phys_ApplyTorqueCenter, which then throws "Native is not bound" error when the extension is not installed. This makes the plugin compile with or without include and still run with or without the extension, except with the above error when ext missing: PHP Code:
PHP Code:
Spoiler
|
Re: Optional VPhysics extension
I faced same issue in our 'sound attenuation' plugin. The only official way I know is:
PHP Code:
And that's bad sm doesn't expose more functions for such check, at least to retrieve extension's name by index. There is one walkaround: you can send ServerCommandEx cmd:
Spoiler
to intercept server answer. So, by parsing that you can surely identify whether extension of your interest is loaded. Again, until somebody patch sm exts command to hide output. |
Re: Optional VPhysics extension
You can use GetFeatureStatus to check if the native is available.
|
Re: Optional VPhysics extension
Quote:
Will use for any future work using optional extensions. Thanks again. |
All times are GMT -4. The time now is 10:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.