Jump to content
JohnHSmith

get variable from servers missionnamespace

Recommended Posts

I saved an array in a variable from the server using

{
	_players pushBack _x;
} forEach playableUnits;
missionNamespace setVariable[ "array", _players ];

in the server scope.

 

How to load it from client scope? I tried something like this

_ply = { missionNamespace getVariable ["array", []]; } remoteExec ["bis_fnc_call", 2];
if( player in _ply ) then { diag_log "you're an player"; }

But this won't work.  Can anyone give me an idea?

Share this post


Link to post
Share on other sites
6 minutes ago, JohnHSmith said:

I saved an array in a variable from the server using


{
	_players pushBack _x;
} forEach playableUnits;
missionNamespace setVariable[ "array", _players ];

in the server scope.

 

How to load it from client scope? I tried something like this


_ply = { missionNamespace getVariable ["array", []]; } remoteExec ["bis_fnc_call", 2];
if( player in _ply ) then { diag_log "you're an player"; }

But this won't work.  Can anyone give me an idea?

What are you trying to do?

 

Cheers

Share this post


Link to post
Share on other sites

Try setting the third parameter of setVariable to true. this will send the variable over network.

 

 

Share this post


Link to post
Share on other sites
1 minute ago, Grumpy Old Man said:

What are you trying to do?

 

Cheers

The Array is not only from players, just edited to show it is filled with player objects.

 

1 minute ago, gc8 said:

Try setting the third parameter of setVariable to true. this will send the variable over network.

 

 

Should I load it as it is done?

Share this post


Link to post
Share on other sites
2 minutes ago, JohnHSmith said:

Should I load it as it is done?

 

sorry don't understand the question. Here's example:

 

server:

missionNamespace setVariable["array", _players, true ];

client:

_players = missionNamespace getVariable["array",[]];

 

that should work

  • Thanks 1

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

×