I must be doing this wrong some how and can't figure it out, nothing I try works. I took the code that Jshock provided and saved it as "towWhitelist.sqf" in my scripts folder. Then I added [] execVM "scripts\towWhitelist.sqf" to my init.sqf. From there I created an area in my mission and named it "towZone" this being the area I only want whitelisted players able to enter. Then I placed down a helipad while testing named "zoneTP" this being the place non-whitelisted players get tp'd to. I then try to test the mission in an MP environment but get an error message as soon as I finish loading. Can anybody help solve this issue? I will provide links to images of the error.
1. Original Code Provided (edited to work with my markers)
private _myWhiteList = ["id1","id2","id3"];
while {true} do
{
{
if ((!getPlayerUID _x in _myWhiteList) && _x inArea "towZone") then
{
_x setPos getMarkerPos "zoneTP";// or getPos "zoneB", depending on what the zones are
};
} count allPlayers;
sleep 3;
};
2. Link to image of Error Message
http://prnt.sc/cjp7vj
3. Link to 2d image of "Restricted" area marker
http://prnt.sc/cjp82f
4. Link to 3d image of "Restricted" area marker
http://prnt.sc/cjp7ms