OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: seregavlg on 24 May 2011, 06:13:07
-
Hi alll!
How i can tag ammobox? but this tag should visible from 150- 200m
-
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.
-
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
-
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.
-
thanks , i try create RscTitles & call them with cutRsc...
argh!!!!! not this way....
-
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
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;} ;