Jump to content
Sign in to follow this  
lxets

Server sided stuff

Recommended Posts

I'm making a multiplayer mission with some server sided code for practice, and one of the main things I'm wondering is how I should run a server sided function for a specific client. I currently have a server sided function which updates a teams score and awards a player money and is called from the killed event handler. I currently broadcast the function as a public variable so I can call it on the client (using BIS_fnc_MP) but im wondering if there is a better way to do this, as I've been looking at several missions and everyone does it differently. Sorry if this is hard to understand, I know what I mean but cant really explain it as well as I want  :)  

 

I'm also wondering if there are any fundamental things I should be doing when creating a server side for my mission, as this is the first time I've attempted it and have currently just being going with trial and error and looking at various other missions as examples, but as everyone does it differently its hard to know if there is a 'correct' way to do something and what is actually needed.

 

Thanks.

Share this post


Link to post
Share on other sites

One of my favorite ways to make a client execute some code is like below: 

 

    [
    [
    [_Param1],
    {
      _Param1 = _this select 0;
      [_Param1] call CoolFunctionHere;
   }],"BIS_fnc_spawn",_Killer,false,false] spawn BIS_fnc_MP;
 
The _Killer is a unit controlled by the client you want to run the script
 
 
OR
 

PlaySoundEverywhere = compileFinal "_this select 0 say3D (_this select 1);";




[[_marauder,_RandomNoise],"PlaySoundEverywhere"] call BIS_fnc_MP;

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  

×