Jump to content
Sign in to follow this  
=101AD=Richard

Attachto Global

Recommended Posts

I have a script to move a image in front of a shooter, The range master not the shooter starts the script from a remote location and I want these images to move in front of the shooter. The problem is the attachto command is executing locally becuase the script is I think. I want just the attachto to execute globally how can I do that?

//////////////////////////////////////////////////////////////////
// Function file for Armed Assault
// Created by: Richard / Dodes
//////////////////////////////////////////////////////////////////

_inc     = 0;
_count   = 0;
_count1   = 0;
_count2   = 0;
_targets = [pt3, pt3_1, pt3_2, pt3_3, pt3_4];
_many    =  count _targets;
_many1    =  count _targets;
_many2    =  count _targets;
nopop=true;
{_x  animate["terc",1]} forEach _targets;

R1Start attachTo [R1Ins,[2.7,-.05,.8]];
"Welcome to the 172nd Infantry Brigade's Live Fire Rifle Qualification Range; Lane 1" call CBA_fnc_systemChat;
sleep 3;
"Lane 1: Setting up the Range" call CBA_fnc_systemChat;
"Lane 1: Please Step up to the line in the Standing Position" call CBA_fnc_systemChat;
sleep 3;
"Lane 1: The Qualification Course will begin in 5 Seconds" call CBA_fnc_systemChat;
sleep 3;
"Lane 1: The Qualification Course will begin in 2 Seconds" call CBA_fnc_systemChat;
sleep 2;
"Lane 1: Begin!" call CBA_fnc_systemChat;
detach R1Start;
R1Start attachTo [R1Ins,[2.7,-.05,-5]];
R1Standing attachTo [R1Ins,[2.7,-.05,.8]];
sleep 3;
detach R1Standing;
R1Standing attachTo [R1Ins,[2.7,-.05,-5]];


while {_inc<20} do 
{
_rnumber = floor random _many;
_rtarget = _targets select _rnumber;
_rtarget animate["terc", 0];
sleep 4;
if (_rtarget animationPhase "terc" > 0.1) then
{
	_count = _count+1;
	    };
_rtarget animate["terc", 1];
_inc = _inc + 1;
};
R1Crouch attachTo [R1Ins,[2.7,-.05,.8]];
sleep 4;
detach R1Crouch;
R1crouch attachTo [R1Ins,[2.7,-.05,-5]];
"Lane 1: Go to Crouch Position" call CBA_fnc_systemChat;
sleep 4;
_inc1  = 0;

while {_inc1<10} do 
{
_rnumber1 = floor random _many1;
_rtarget1 = _targets select _rnumber1;
_rtarget1 animate["terc", 0];
sleep 4;
if (_rtarget1 animationPhase "terc" > 0.1) then
{
	_count1 = _count1+1;
	    };
_rtarget1 animate["terc", 1];
_inc1 = _inc1 + 1;
};
R1Prone attachTo [R1Ins,[2.7,-.05,.8]];
sleep 4;
detach R1Prone;
R1Prone attachTo [R1Ins,[2.7,-.05,-5]];
"Lane 1: Go to Prone Position" call CBA_fnc_systemChat;
sleep 4;

_inc2 = 0;

while {_inc2<10} do 
{
_rnumber2 = floor random _many2;
_rtarget2 = _targets select _rnumber2;
_rtarget2 animate["terc", 0];
sleep 4;
if (_rtarget2 animationPhase "terc" > 0.1) then
{
	_count2 = _count2+1;
	    };
_rtarget2 animate["terc", 1];
_inc2 = _inc2 + 1;
};
R1Complete attachTo [R1Ins,[2.7,-.05,.8]];
sleep 4;
detach R1Complete;
R1Complete attachTo [R1Ins,[2.7,-.05,-5]];
sleep 4;
"Lane 1: Course Complete" call CBA_fnc_systemChat;
[West, "HQ"] sidechat format ["Lane 1: Targets :%1 Hit-T :%2",_inc2+_inc+_inc1,_count+_count1+_count2];

Share this post


Link to post
Share on other sites

According to the wiki, attachTo only has to be executed on one client and should have a global effect.

Are you sure this works?:

[2.7,-.05,-5]];

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  

×