Home   Help Search Login Register  

Author Topic: ammobox tag  (Read 2898 times)

0 Members and 1 Guest are viewing this topic.

Offline seregavlg

  • Members
  • *
ammobox tag
« on: 24 May 2011, 06:13:07 »
Hi alll!
How i can tag ammobox?  but this tag should visible from 150- 200m

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: ammobox tag
« Reply #1 on: 24 May 2011, 20:05:20 »
Hi seregavlg and welcome to OFPEC,

I'm not entirely sure what you mean - "tag" an ammobox? Do you mean add some kind of marker or something to it that's visible from a distance, or what? Why would you want to do this (usually people just add a map marker on top of the thing they want people to find), exactly? Give some more information, and we might be able to help :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline seregavlg

  • Members
  • *
Re: ammobox tag
« Reply #2 on: 25 May 2011, 11:47:01 »
Hi Wolfrug, i make mp mission.
"tag" - marker on screen, ex. when you select unit in your squad you see "tag" (unit location  & direction of unit location). Simple way use map marker,   but i want turn off map. and thanks for reply

Offline Pirin

  • Members
  • *
Re: ammobox tag
« Reply #3 on: 25 May 2011, 19:51:02 »
You could possibly set a task and a task destination to the ammo box.  That'll appear as a gold marker in the game world.

Offline seregavlg

  • Members
  • *
Re: ammobox tag
« Reply #4 on: 25 May 2011, 21:28:51 »
thanks , i try create RscTitles & call them with cutRsc...

argh!!!!! not this way....
« Last Edit: 26 May 2011, 06:54:25 by seregavlg »

Offline seregavlg

  • Members
  • *
Re: ammobox tag
« Reply #5 on: 02 Jun 2011, 20:10:22 »
Hi . Guys please help me, where errors?
I download pvp script pack  and want use anticamp feature  in my mission
 Before "anticamptask" array "availtags" is full, but "releasetag" don't work.
array availTags [control # 65100 ......... 65109] = 10 tags
after release tag array availTags [control # 65100 ......... 65100]  = 3677 tags

Code: [Select]
if (isNull player) exitwith {} ;

#define START_TAG 65100
#define NUMTAGS 10
//************************
#define EL(v,i) ((v) select (i))
#define ARG0 (_this select 0)
#define ARG1 (_this select 1)

//************************
xPlayableUnits={
     private ["_pl"] ;
     _pl = PlayableUnits;
     if (count _pl ==0) then {
  _pl = _pl + [player] ;
     } ;
     _pl
} ;

VAR_DEFAULT(CTF_antiCamp,false) ;

tagp = 1;
if (CTF_antiCamp == true) then {
     [] spawn {[] call anticampTask; };};

anticampTask={
     while {tagp == 1} do {
    if ( tagp == 1 ) then
{
a = [];
  {if ((side _x) == playerSide) then
     {a = a + [_x]};
  }forEach allUnits;
{[_x,[1,0,0,1]] spawn {_this call playerTracker;} ;}foreach a;
        };
            } ;
       sleep 0.01 ;
  };
  sleep 1 ;


availTags=[] ;
/*
tagInit={
     private ["_c","_hud"] ;
     disableSerialization ;
     waitUntil {not hudIsHidden} ;
     _hud = uiNamespace getVariable "HUD";
     for "_c" from 0 to (NUMTAGS-1) do {
  availTags set [_c,_hud displayCtrl (START_TAG+_c)] ;
     } ;
} ;
*/
claimTag={
     private ["_t"] ;
     _t = objNull ;
     if (count availTags >0) then {
  _t = EL(availTags,0) ;
  availTags = availTags -[_t] ;
     } ;
     _t ;
} ;

releaseTag={
     ARG0 ctrlSetTextColor[0,0,0,0] ;
     ARG0 ctrlsetPosition [-0.1,-0.1] ;
     ARG0 ctrlCommit 0 ;
     availTags=availTags+[ARG0] ;
} ;

playerTracker ={

     private ["_t","_u","_p" ];
     disableSerialization ;
     _u = ARG0 ;
     _t = [] call claimTag ;
     if (not isNull _t) then {
  _t ctrlSetTextColor ARG1 ;
  _t ctrlSetFade 0 ;
  while {alive _u } do {
       _t ctrlSetText format ["%1 - %2m",name _u,ceil (_u distance player)] ;
       _p = position _u;
       if (count _p < 3) then {_p set [2,0];} ;
       if (EL(_p,2) < 2) then {_p set [2,2];} ;
       _p = worldtoscreen _p;
       if (count _p != 2) then {
    _p = [2,2] ;
       } ;
       _p set [2,0.2];
       _p set [3,0.02];
       _t ctrlSetposition _p ;
       _t ctrlCommit 0.01 ;
       sleep 0.01 ;
  } ;
  _t ctrlSetFade 1 ;
  _t ctrlCommit 0.5 ;
  sleep 1 ;
  [_t] call releaseTag ;
     };
} ;

[] spawn {call tagInit;} ;