JohnHSmith 0 Posted June 6, 2018 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
Grumpy Old Man 3550 Posted June 6, 2018 On 6/6/2018 at 1:30 PM, 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
gc8 981 Posted June 6, 2018 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
JohnHSmith 0 Posted June 6, 2018 On 6/6/2018 at 1:36 PM, 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. On 6/6/2018 at 1:37 PM, 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
gc8 981 Posted June 6, 2018 On 6/6/2018 at 1:39 PM, 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 1 Share this post Link to post Share on other sites
JohnHSmith 0 Posted June 6, 2018 Thank you, you saved my day ;) Share this post Link to post Share on other sites