Jump to content
  • 0

Attachto and detach


Schultz

Question

Hello,

 

I'm testing a script that lets you detain other players, and it also has an option for escorting them. Basically it puts the target into a standing tied animation and it attaches it in front of you.

 

Everything works, except for releasing them. All other parts of the script work (removal of walk limitation etc) but sometimes the target stays attached to you

 

This is the code for the stop_escort.sqf

player removeAction act4;
player forceWalk false;
_newCiv = cursorTarget;
_dist = player distance _newCiv;
_newCiv setVariable ["Detain",0,true];
sleep 1;
detach _newCiv;
_newCiv setVariable ["Detain",1,true];
PVDZ_ply_Arrst = _newCiv;
publicVariable "PVDZ_ply_Arrst";
[objNull, _newCiv, rswitchmove ,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;

I am really banging my head against this, but maybe another fresh point of view will help me!

 

The problem is that my cursor is slightly to the right of the guy who's attached to me, hence if I don't manually aim it's not gonna be detached.

 

Is there a way to define instead of cursorTarget something like the closest player to me?

 

Any ideas?

Link to comment
Share on other sites

Recommended Posts

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...