OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: laggy on 15 Feb 2009, 22:56:59

Title: NO selectPlayer in Multiplayer?
Post by: laggy on 15 Feb 2009, 22:56:59
Tried all this on dedi:

Just two men on Rahmadi, one BLUFOR and one CIV.
Both are "playable" from start.

Repeatedly Radio Alpha Trigger:

newguy = (nearestObjects [player, ["Man"], 50]) select 1;
addSwitchableUnit newguy;
newguy disableAI "MOVE";
newguy disableAI "TARGET";
newguy disableAI "AUTOTARGET";
newguy disableAI "ANIM";
selectPlayer newguy;

When I switch to the "newguy" I don't get full control over him, it's as if the AI is still working.
When I start running I get teleported to the original position.
If I turn to the side I get turned back.
If I lay down I rise back up.

When I switch back to my original playing unit, it works fine.

Does anyone know if the selectPlayer command works at all in MP? It would be cool if it did.

Laggy
Title: Re: NO selectPlayer in Multiplayer?
Post by: i0n0s on 16 Feb 2009, 00:08:17
The selectPlayer works. But the unit has to be local:
Code: [Select]
_grp = group newguy;
_leader = leader _grp == newguy;
[newguy] joinSilent player;
oldguy = player;
selectPlayer newguy;
[newguy] joinSilent _grp;
if (_leader) then {_grp selectLeader newguy};
Don't forget one thing:
As soon as newguy dies the player don't respawn, not even as seagull. So add a killed-handler to switch back to the players original figure.
Title: Re: NO selectPlayer in Multiplayer?
Post by: laggy on 16 Feb 2009, 10:07:17
Thanks a lot,

Have to try this out  :clap:

Laggy