Jump to content
  • 0

call plotGetFriends to use with base protection script?


kingpapawawa

Question

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

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...