Jump to content
Sign in to follow this  
deadbeat

get global variable from addon or spawn script from addon

Recommended Posts

Hi so I have been trying to figure out how to call a script from an add-on.

The add-on is not a mod it is just the server code of the mission file but in a pbo so that people can't steal it, but I don't quite understand how to access a script now that i want to run on the client.

So we have fnc_hud in the server.pbo or @serverSide add-on.

Then I want to do something like:

//Server Code
fnc_hud = compile preprocessFile "scripts\functions\fnc_hud.sqf";

Then:

//Client Code
[] spawn fnc_hud;

But due to the nature of me having my servercode in a pbo I think there is an issue with the global variable ??

Thanks

Share this post


Link to post
Share on other sites

Is that Client Code part executed on clients?

fnc_hud has not been preprocessed on clients, so their machine doesn't know what fnc_hud is.

Then again, you're overcomplicating it: why have mission code in a different pbo?

Share this post


Link to post
Share on other sites

Maybe look into how MCC does it's control panel which is one player at a time?

Share this post


Link to post
Share on other sites

Yup, the best way would probably be to use CBA.

But it's still going to be an awful lot of info sharing if you have to transmit the whole function to all clients.

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  

×