Jump to content
Sign in to follow this  
demonized

cursorTarget MP use?

Recommended Posts

if i have a unit with this in initline:

_null = [this] execVM "script.sqf"

script.sqf:

_DCPlayer = _this select 0;
_target = cursorTarget;
_kv = _DCPlayer knowsAbout _target;

if (_kv == 4) then {
if (player == _DCPlayer) then {
	_myaction = __DCPlayer addAction ["action", "script2.sqf"];
	waitUntil {_target != cursorTarget};
	sleep 1;
	_DCPlayer removeAction _myaction;
};
};

Question: If i have this script run on several players in MP game, will cursortarget be the cursor target of the player running the script (_DCPlayer = _this select 0)?

Or will it break and show any cursor target from any player or just simply not work in MP?

Share this post


Link to post
Share on other sites
	_myaction = __DCPlayer addAction ["action", "script2.sqf"];

Haven't checked the entire intention yet, but this stands out... :p

Share this post


Link to post
Share on other sites

lol yes, i took the script part showed out of a bigger script im trying to make.

But say 5 players are in a town, and everyone is looking at a different target, and all have this script run on them, will each players cursortarget be what the player is looking at in the script?

player1s cursorTarget in script is object1, player 2 has object2, player 3.....

does command cursortarget know wich player its used on?

Edit: ah yes a typo.. noticed that now.

Still im confused on how cursortarget behaves in script when used on multiple players.

I know it works as intended in SP and in SP editor.

Edited by Demonized

Share this post


Link to post
Share on other sites

Still im confused on how cursortarget behaves in script when used on multiple players.

I know it works as intended in SP and in SP editor.

cursorTarget is a local command which returns an object on the local player client (where the cursor of the player is pointing at).

Xeno

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  

×