Jump to content
Sign in to follow this  
celery

selectPlayer and created units

Recommended Posts

I have tried to use createVehicle and createUnit to create a new man, but the selectPlayer command doesn't work on them. Is it even possible to switch into a unit created with a script?

Share this post


Link to post
Share on other sites

I tried the following script, and it worked in MP on a dedicated server:

test.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@ (time > 1)

hint format["%1", typeOf player]

~10

_newunit = group player createunit["SquadLeaderE", position player, [], 0, "FORM"]

selectPlayer _newunit

hint format["%1", typeOf player]

~10

_newunit = group player createunit["SoldierGNOG", position player, [], 0, "FORM"]

selectPlayer _newunit

hint format["%1", typeOf player]

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this] exec "test.sqs"in the init field of the initial unit.

Share this post


Link to post
Share on other sites

yeah, the created unit has to be 'local' to the computer where the unit you are issuing the 'selectPlayer' on lives...

hence the above works 'cause the new unit is joining the players group...

Share this post


Link to post
Share on other sites

It worked fine in singleplayer but not in multiplayer. Can it be made to work online?

Share this post


Link to post
Share on other sites

When done online I assume the form of the new unit, but the old one still has my identity and so I don't get any more points for kills after switching. I tried to delete the old unit but with no success and it keeps respawning when he's killed.

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  

×