Home   Help Search Login Register  

Author Topic: Determing the side owning a flag  (Read 448 times)

0 Members and 2 Guests are viewing this topic.

Rocko Bonaparte

  • Guest
Determing the side owning a flag
« on: 27 Oct 2004, 06:37:48 »
I am trying to write a function for assigning the flag to the driver of my single-player vehicles for an multiplayer mod I am developing.  I added some additional logic to make sure only the crew of the playable vehicles can get the flag.  Now I'm trying to put some logic in place to make sure the right flag for the right side is checking for the right vehicle.  The code looks like this:
Code: [Select]
private ["_flag", "_zone_list"];

_flag = _this select 0;
_zone_list = _this select 1;

hint format ["%1", side _flag];

if(side (flagowner _flag) == east) then {

   {
      if((typeof _x) == "M1A1_1P") then {

         _flag SetFlagOwner ((crew _x) select 0);
         break;
      };
   } forEach _zone_list;
};

if(side _flag == west) then {

   {
      if((typeof _x) == "T80_1P") then {

         _flag SetFlagOwner ((crew _x) select 0);
         break;
      };
   } forEach _zone_list;
};

true
There's not one problem -- the flags are considered "civilian." The hint command in the function shows the side as "CIV."  :'(

I tried to force the flags to different sides in my mission, but they're still locked to civilian:
Code: [Select]
      class Item0
      {
         position[]={7090.451172,104.907120,8935.690430};
         id=1;
         side="EAST";
         vehicle="FlagCarrier";
         skill=0.200000;
         text="east_flag";
         init="this setflagtexture ""rus_vlajka.pac""; this setflagside east";
      };
      class Item1
      {
         position[]={7154.740723,105.344994,8987.620117};
         id=2;
         side="WEST";
         vehicle="FlagCarrier";
         skill=0.200000;
         text="west_flag";
         init="this setflagtexture ""usa_vlajka.pac""; this setflagside west";
      };
So is there way to modify the flags so the code will work as it is, or should I try a different implementation?  Can this even be done?