Forum Jump :

Author Message


Posts: 1
Rank:


Level: Member

Country: cz
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-10-10 11:04        
     
So I was trying to make the script myself but I am too dumb for this stuff.

I tried to simplify so I need to addaction to the object (man) that needs to be captured. There will be numerous men who can be captured depending how many slots will be taken.

I guess in the init field of the unit will be script exec. I need to define varible for man who can be captured and variable for his capturer. Afterwards the script needs to check side of capturer and teleport the captured to his side's prison.



// init line this addAction ["Capture","capture.sqf",this,1,false,true,"","(_target distance _this) < 3"]

_captured = _this select 0;  
_capturer = _this select 1;  

   if (side _capturer == west)  then
   {
      removeAllWeapons _captured;
      _captured setpos getmarkerpos WestPrison;
      _capturer groupchat "Enemy Captured"
         sleep 0.5;
   } 
      if (side _capturer == east)  then
   {
      removeAllWeapons _captured;
      _captured setpos getmarkerpos EastPrison;
      _capturer groupchat "Enemy Captured"
         sleep 0.5;
   } 
      if (side _capturer == Resistance)  then
   {
         _capturer groupchat "You cannot capture your own faction!"
         sleep 0.5;
   } 
   
};



Also I do not know how to determine if all targeted players all captured - if they are mission should end.

Can anyone help me please? :)


Author Message


Posts: 17
Rank:


Level: Member

Country: nl
Location:
Occupation:
Age:
In-game name: Arctor [sh33p]

 
#2 Posted at 2013-10-28 04:04        
     
Two suggestions:
rename _capturer (make script more readable)
script suffers from severe lack of semi-colons (close all lines with ; )

Keep at it, you'll get there!


oh and get rid of the last };
it has no opening counterpart.