Jump to content

Recommended Posts

Hello everyone, I come to see you today because I have a problem with code that does not want to work in multiplayer, while the code works perfectly in solo.

My code is to remove the array that contains objNull in a tri-dimensional array.


the array in question:

[[3ec9abcb80# 1676278: plasticbarrier_03_f.p3d,[12179.4,12946.3,-0.0794725]],[<NULL-object>,[12178,12947.7,0]],[3eb888c080# 1676280: roadcone_l_f.p3d,[12178.8,12949.9,0]]]


and the complete code:


_target = cursorTarget;
_player = player;
_PlayerUid = getPlayerUID _player;
_PlacedOject = _player getVariable "PlacedOject";
_UIDObject = _target getVariable "deploy_user_uid";

if (isnil {_UIDObject}) exitWith {hint "aucun object détecter"};

if ( !(_UIDObject == _PlayerUid) ) exitWith {hint "Cette Object, ne vous appartient pas"};
if ( count _PlacedOject == 0 ) exitWith {hint "Vous avait aucun object placée"};

	_Element = _PlacedOject select _forEachIndex;
	_Elementplaced = _Element select 0;
	_ElementPosArray = _Element select 1;

	if (_Elementplaced isEqualTo objNull) then
		_Element resize 0;
} forEach _PlacedOject;
//_PlacedOject deleteAt (_PlacedOject find _target); // existent item

//deleteVehicle _target;

sorry for average English it's not my first language

Share this post

Link to post
Share on other sites

From what I can tell it's not going to work if it's only being run on the server because of these lines: "_target = cursorTarget;   _player = player;"


How are you executing your script and what exactly is it doing that is unexpected or is it not doing that you expected it to do?

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