Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Recommended Posts

While working on a dialog of mine, I was trying to use the below code to freeze another friend of mine on the server. 

_selectedIndex = lbCurSel 1500;
_selectedPlayer = (PlayerList select _selectedIndex);
hint format ["Index: %1 Player: %2",str _selectedIndex,str _selectedPlayer];

if (_selectedPlayer getVariable ["pVar_Frozen",false]) then {
	_selectedPlayer enableSimulation true;
	hint format ["You've unfrozen %1!",_selectedPlayer];
	_selectedPlayer setVariable ["pVar_Frozen",false,true];
} else {
	_selectedPlayer enableSimulation false;
	hint format ["You've frozen %1!",_selectedPlayer];
	_selectedPlayer setVariable ["pVar_Frozen",true,true];
};

On my client, my friend was frozen, but would "vibrate". I thought it was weird, and since he didn't say anything I asked if he was frozen, and he told me he wasn't, which is why he was "vibrating" I guess... Server trying to move him on my end, yet he'd kinda not movable on my end. I've tried enableSimulationGlobal, and that seemed to work even less. Do I need to use remoteExec, and for the target, set my selected player as the target?

Share this post


Link to post
Share on other sites
1 hour ago, Blue92 said:

While working on a dialog of mine, I was trying to use the below code to freeze another friend of mine on the server. 


_selectedIndex = lbCurSel 1500;
_selectedPlayer = (PlayerList select _selectedIndex);
hint format ["Index: %1 Player: %2",str _selectedIndex,str _selectedPlayer];

if (_selectedPlayer getVariable ["pVar_Frozen",false]) then {
	_selectedPlayer enableSimulation true;
	hint format ["You've unfrozen %1!",_selectedPlayer];
	_selectedPlayer setVariable ["pVar_Frozen",false,true];
} else {
	_selectedPlayer enableSimulation false;
	hint format ["You've frozen %1!",_selectedPlayer];
	_selectedPlayer setVariable ["pVar_Frozen",true,true];
};

On my client, my friend was frozen, but would "vibrate". I thought it was weird, and since he didn't say anything I asked if he was frozen, and he told me he wasn't, which is why he was "vibrating" I guess... Server trying to move him on my end, yet he'd kinda not movable on my end. I've tried enableSimulationGlobal, and that seemed to work even less. Do I need to use remoteExec, and for the target, set my selected player as the target?

 

Check the wiki:

Exec_Server.gif

 

means the command needs to be executed on the server, like so:

[_selectedPlayer,false] remoteExec ["enableSimulationGlobal",2];

 

Alternatively you can use disableUserInput.

 

Cheers

Share this post


Link to post
Share on other sites

I'd go for using enableSimulationGlobal, as @Grumpy Old Man suggested.

 

Another option would be to play a specific looping animation:

//freeze
[_unit, "Acts_WarmupBase"] remoteExec ["switchMove",_unit];
// unfreeze
[_unit, ""] remoteExec ["switchMove",_unit];

 

9 hours ago, Grumpy Old Man said:

Alternatively you can use disableUserInput.

Oh god. That's fire you are playing with.

Share this post


Link to post
Share on other sites
24 minutes ago, 7erra said:

Oh god. That's fire you are playing with.

Once upon a time there was a rather well visited MP server with debug console enabled for everyone, for some reason nobody was doing anything with it.

remoteExecs and fun happened.

 

Cheers

  • Haha 1

Share this post


Link to post
Share on other sites

×