Jump to content
  • 0

Better Tag Friendlies


prominentalex

Question

Recommended Posts

  • 0
 player_tagFriendly_2.sqf with GPS and Radio requirements
 
private ["_target","_caller","_callerUID","_targetUID","_name","_rfriendlies","_itemsPlayer","_hasRadio","_hasGPS","_callerID"];
_target = _this select 0;
_caller = _this select 1;
_name = name _target;
_itemsPlayer = items player;
_hasRadio = "ItemRadio" in _itemsPlayer;
_hasGPS = "ItemGPS" in _itemsPlayer;
call fnc_usec_medic_removeActions;
r_action = false;
 
_callerID = _caller getVariable "CharacterID";
_rfriendlies = _target getVariable ["friendlies", []];
 
if ((_callerID in _rfriendlies) && (_hasRadio && _hasGPS))then {
 
        _callerUID = getPlayerUID _caller;
        _targetUID = getPlayerUID _target;
 
        FriendlyESPArray = FriendlyESPArray + [_targetUID];
 
        _caller publicVariableClient "FriendlyESPArray";
 
        titleText [format["You've established radio contact with %1.",_name], "PLAIN DOWN", 3];
 
        } else {
    
        titleText [format["You need to have a Radio, GPS and be friends with %1 before you can establish radio contact.",_name], "PLAIN DOWN", 3];          
                
    };
 
now need to figure out how to remove group icons if a player drops the gps or radio
Link to comment
Share on other sites

  • 0

Search for this and remove it
 

				if ((groupIconsVisible select 0) || (groupIconsVisible select 1)) then
				{
					[] spawn "+_randvar2+";
					"+_randvar10+" = [_name, _puid, toArray 'GroupIcons', toArray (str groupIconsVisible)];
					publicVariableServer '"+_randvar10+"';
				};
				setGroupIconsVisible [false,false];
				_state = true;
setGroupIconsVisible
groupIconsVisible

That should do it

Link to comment
Share on other sites

  • 0

Search for this and remove it

 

				if ((groupIconsVisible select 0) || (groupIconsVisible select 1)) then
				{
					[] spawn "+_randvar2+";
					"+_randvar10+" = [_name, _puid, toArray 'GroupIcons', toArray (str groupIconsVisible)];
					publicVariableServer '"+_randvar10+"';
				};
				setGroupIconsVisible [false,false];
				_state = true;
setGroupIconsVisible
groupIconsVisible

That should do it

 

Which parts exactly? You confused me with the last two quotes. Do I just take out those lines? "groupIconsVisible" & "setGroupIconsVisible"

Link to comment
Share on other sites

  • 0

Maybe my other thread might help you guys here, working off some code i used to use on my old dayz servers a year or so ago:

 

 

the code was:

// create tags
{
    if (isPlayer _x) then {
    _rcharID = _x getVariable ["characterID", "0"];
    _rfriendlies = _x getVariable ["friendlies", []];
    _rfriendlyTo = _x getVariable ["friendlyTo", []];
    if ((_rcharID in _friendlies) and (_charID in _rfriendlies)) then {
    if (!(_charID in _rfriendlyTo)) then {
    _position = [0,0,0];
    _tag = "Sign_sphere10cm_EP1" createVehicleLocal _position;
    _tag attachTo [_x,[0,0,0],"lwrist"];
    _tag setVariable ["belongsTo", _rcharID];
    _rfriendlyTo set [count _rfriendlyTo, _charID];
    _x setVariable ["friendlyTo", _rfriendlyTo, true];
    _tagList set [count _tagList, [_x, _tag]];
    player setVariable ["tagList", _tagList];
    titleText [format["You and %1 are now tagged as friendlies.", (name _x)], "PLAIN DOWN"];
    };
};
};

you can change the _tag = "Sign_sphere10cm_EP1" createVehicleLocal _position; to whatever you wanted, i had it the downward facing red arrow you see when buying a vehicle at the merchants.. it was obnoxious.. but no missing it.. you can change it to whatever you want.. usa flag, whatever

 

I AM STILL TRYING TO FIGURE OUT HOW TO IMPLEMENT THIS THO

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...