Jump to content
frosties

Get position of player

Recommended Posts

Hello, 

 

Im currently using this linfe to create a respawn position:

_grouprespawnp1 = [group1, "p1"] call BIS_fnc_addRespawnPosition; 

And it works fine, however sometimes when the player is in a building, the player respawning on that player will spawn on the roof.

Been trying to use the getPos to get the positiion of that player to spawn in on the same position but haven succeeded yet so im asking for help here. 

 

Any ideas? 

Share this post


Link to post
Share on other sites

Ive been trying several ways but none is working.

 

This is what im working with now:

 

_pos = GetPosATL p1; (p1 is the units name in editor)

 

It seems to work, however the icon of the player and name changes. So it doesnt show what role the player has, or their name just the "SE of ..." thingy.

Any way to adjust the height while still keeping the spawn working as before?

Share this post


Link to post
Share on other sites

Ive been trying several ways but none is working.

 

This is what im working with now:

 

_pos = GetPosATL p1; (p1 is the units name in editor)

 

It seems to work, however the icon of the player and name changes. So it doesnt show what role the player has, or their name just the "SE of ..." thingy.

Any way to adjust the height while still keeping the spawn working as before?

 

I don't know if this is helpful, but I use this to create a variable in the object namespace of the player object when they respawn.  This variable contains the string which is identical to the string that is displayed by the "role" that they selected in the respawn screen.  

 

I use this to create roles like "pilot" with the BIS default respawn screen and enforce other custom restrictions such as only allowing pilots to get in the driver seat of aircraft.

 

You may be able to look at the respawn functions in the functions viewer in the editor and find some important variables, and use those in a function similar to this to get a reference to the player object that the respawn position is on, and then setPos the respawning player after they spawn to a more suitable location.

disableSerialization;

params [
["_unit", objNull, [objNull], 1]
];

_rList = uiNamespace getVariable (["BIS_RscRespawnControlsMap_ctrlRoleList", "BIS_RscRespawnControlsSpectate_ctrlRoleList"] select (uiNamespace getVariable ["BIS_RscRespawnControlsSpectate_shown", false]));
_rName = _rList lbText (lbCurSel _rList);
_unit setVariable ["JWL_respawnRole",(toUpper _rName)];

true

I call this function from onPlayerRespawn.sqf, and pass the new unit ("_this select 0" in onPlayerRespawn.sqf) as the only parameter.

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

×