mindbl4ster 10 Posted September 1, 2014 hi there, i tried various ways to handle this problem but nothing works as it should and now i do need help with it. my intention is to pass the playerobject from the initplayerlocal.sqf to a function that should freeze him after spawning. but actually i get the error that the function does not get the right form of parameters ?! can somebody help me out with it please ? thanks! initplayerlocal.sqf: _localplayer = [_this select 0]; [_localplayer ,true] call mbicr_fn_freeze; fn_freeze: private ["_listOfUnits","_conditionMovement"]; _listOfUnits = _this select 0; _conditionMovement = _this select 1; hint format ["%1, %2", _listOfUnits, _conditionMovement]; if (_conditionMovement) then { { _x disableAI "ANIM"; _x enableSimulation false; cutRsc ["default", "BLACK", 20]; } foreach _listOfUnits; } else { { _x enableAI "ANIM"; _x enableSimulation true; cutRsc ["default", "PLAIN",1]; } foreach _listOfUnits; }; Share this post Link to post Share on other sites
SilentSpike 84 Posted September 1, 2014 _localplayer is a unit and your function expects an array of units. So just put square brackets around _localplayer in the call line to turn it into a singular array. Share this post Link to post Share on other sites
mindbl4ster 10 Posted September 1, 2014 (edited) i converted _localplayer already to an array in the first line of code? _localplayer = [_this select 0]; edit: ok ... now i do not get any error, but the function still does not work :( Edited September 1, 2014 by mindbl4ster Share this post Link to post Share on other sites
SilentSpike 84 Posted September 1, 2014 Oh excuse me, I missed that in haste. Looking over it again, I'm just as confused as you are. The only thing I can really think of is that something is confusing the parser. What does fn_freeze: do? Share this post Link to post Share on other sites
Magirot 14 Posted September 2, 2014 It seemed to work fine when I tested it by defining the function on top of initPlayerLocal.sqf. How do you define the function? Looking at the function name you're not using the Functions Library? Should be mbicr_fnc_freeze if you are. Share this post Link to post Share on other sites
mindbl4ster 10 Posted September 2, 2014 (edited) @magirot: thanks for pointing this out ... now it works like a charm :) Edited September 2, 2014 by mindbl4ster Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted September 2, 2014 (edited) If you want to have that unit to be frozen forever, you could simply use the "createVehicle" command as it creates a unit sort of like a mannequin ("lifeless"). Edited September 2, 2014 by waltenberg Share this post Link to post Share on other sites
mindbl4ster 10 Posted September 2, 2014 @waltenberg: thanks for advice but my intention is to freeze the player in a tdm mission until a startsignal (unfreeze) comes from the server. that way i can be sure every player has finished loading the mission and gets the startsignal at the exact same time. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted September 2, 2014 I see. Nevermind then. ^_^ Share this post Link to post Share on other sites