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;} ;