Rather than adding uid to an array in my base protection script i was wondering how i could use the plotpole to manage who can enter my base..
this is the default plotGetFriends.sqf
private ["_name","_plots","_friendlies","_thePlot"];
lbClear 7002;
_plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];
_thePlot = _plots select 0;
_friendlies = _thePlot getVariable ["plotfriends", []];
{
_name = _x select 1;
lbAdd [7002, if (typeName _name == "ARRAY") then {toString _name} else {_name}];
} forEach _friendlies;
then i have a dome.sqf
if ((getPlayerUID player) in ["0","0"]) then {
titleText ["Hello Sir. Welcome home.", "PLAIN DOWN", 1];
} else {
titleText ["This base belongs to ***, leave now.", "PLAIN DOWN", 2];
sleep 3;
titleText ["go away, you arent welcome here", "PLAIN DOWN", 2];
sleep 3;
player setPos [(getPos player select 0) +100, (getPos player select 1) +100, (getPos player select 2) +100];
//player setDamage 1;
};
I tried the following but does not work and no errors.. yes i know i'm a hack and don't know wtf i'm doing lol. It does display the "got this far" text but nothing else happens.
private ["_plots","_friendlies","_thePlot"];
_plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];
_thePlot = _plots select 0;
_friendlies = _thePlot getVariable ["plotfriends", []];
titleText ["got this far", "PLAIN DOWN", 1];
if ((getPlayerUID player) in _friendlies) then {
titleText ["Hello Sir. Welcome home.", "PLAIN DOWN", 1];
} else {
titleText ["This base belongs to ***, leave now.", "PLAIN DOWN", 2];
sleep 3;
titleText ["go away, you arent welcome here", "PLAIN DOWN", 2];
sleep 3;
player setPos [(getPos player select 0) +100, (getPos player select 1) +100, (getPos player select 2) +100];
//player setDamage 1;
};