Jump to content
Radion_Wave

HoldAction doesn't work in Multiplayer [Resolved]

Recommended Posts

Resolution : 
I forgot to put publicVariable for both of my variable so they didn't change globaly and only localy so I just put publicVariable "hideLaat" and publicVariable "hideShield" and it worked !

Hi, 

I'm currently in the process of creating a mission for my friends. (I will take the role of zeus) 
I currently have a problem with the HoldAction command, At first I used the option available inside the Attribute Tab, but I discovered that i didn't work on a dedicated server,
So I searched a bit and found that I needed to use the remoteExec command so that it execute on the server, but even with that i doesn't work and I tried to put it in every file I could (init.sqf, initPlayerLocal.sqf , initPlayerServer.sqf).

There the script : 

[  
 this,  
 "Disable the shield",  
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",  
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",  
 "_this distance _target < 3 and (cresh getVariable 'owner' == WEST)  ", 
 "_caller distance _target < 3",  
 {},  
 {},  
 {hideLaat = false; hideShield = true; removeAllActions shieldTerminal;},
 {},  
 [],  
 5,  
 0,  
 true,  
 false  
] remoteExec["BIS_fnc_holdActionAdd",0,this];

Right now I put this code inside the Init box of the object inside the 3DEN editor when I try with Singleplayer and self Hosted Multiplayer it works perfectly but when I test it on a dedicated Server it doesn't work anymore the HoldAction is shown, I can't re-use it because the removeAllActions works but the code that use hideLaat and HideShield doesn't works (Two trigger with Server Only box checked, that use the Show/Hide Module to show and hide object and vehicles) 

I'm completely lost and don't know what to do anymore.

Thank you.
 

Edited by Radion_Wave
Found the solution to my problem

Share this post


Link to post
Share on other sites

If you write some code in an init field of an edited object, this code will run at server (dedicated or hosted) start then for each joining player (clients). So you never ever need to remoteExec this code everywhere (0).

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

×