Jump to content
Sign in to follow this  
PLBJake

PVP Restrain Script

Recommended Posts

Hey guys, i am wondering how to make it so i can restrain other players in PVP and they can do the same to me. I got it to work slightly but They somehow can restrain themselfs :confused: Is there any way i can avoid this? any help would be great :D

Share this post


Link to post
Share on other sites
Guest
I got it to work slightly but They somehow can restrain themselfs :confused: Is there any way i can avoid this?

If you want help post the script, or should people guess how you made your script and also guess what the error is which causes this behavior?

Share this post


Link to post
Share on other sites

Ah yes sorry. Here is whats in my SQF:

private ["_target", "_id"];

_target = _this select 0;

_id = _this select 2;

_target switchmove "CivilSitting02";

_target disableAI "ANIM";

_target removeAction _id;

_target addAction ["Free,Restrain.sqf"]

Share this post


Link to post
Share on other sites

use conditions in the addaction:

_action = _target addAction ["Restrain", "script.sqf", [], 1, false, true, "", [b]"_target != _this"[/b]];

the highlighted part means that the target of the action cannot be the user of the action.

Share this post


Link to post
Share on other sites

Ok Thank you. One more question. How can i add the action to units via scripts, instead of their init? Sorry for this question, i never made this kind of script before.

Edited by PLBJake

Share this post


Link to post
Share on other sites
Ok Thank you. One more question. How can i add the action to units via scripts, instead of their init? Sorry for this question, i never made this kind of script before.

put this in your init.sqf so it activates the script you have wrote:

[] execVM "myscript.sqf";

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  

×