Jump to content
Sign in to follow this  
CerberDen220

How to update array value for all clients?

Recommended Posts

Basicly, i was in process of making mission, where players must download something from few servers. After making a script in SP, i run into a problems in MP, what a surprise yeah.
 

Spoiler

DataStore=[];

ServerDownload_fnc={ 

_Datasend = round random [10, 15, 20]; 
DataStore pushBack _Datasend; 
_CompletionMean = DataStore call BIS_fnc_arithmeticMean; 
_Complete = (_CompletionMean * count DataStore);

if (_Complete > 99) then {hint "Скачивание данных завершено!";
} 
else 
{ 
hint format ["Скачано %1 процентов данных", _Complete]; 
};

};

Thats a code in SQF file and after HoldAction complete - (_caller call ServerDownload_fnc;) is made.
I guess its dumb approach, at least because i didn't find how to sum all numbers in array.

So problem is idk how to update array for all clients, i tried to use (publicVariable "DataStore";) after IF and ELSE code so its cheks it and updates. Its working but only if host does that. Clients run function and dont sent updated array to other.

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  

×