Jump to content
  • 0

need help with Donater area !!


glowpowner

Question

Hello i need some help a player found a way to get in the donater area

but he is not added to the donater list

 

He showed me how he did it

 

the first 3 times he got teleported away

but the 4e time he can just walk there nothing happens

 

Code i use:

 

if ((getPlayerUID player) in donateList) then {
titleText ["WELCOME BACK TO THE DONATOR CITY! ENJOY YOUR STAY!", "PLAIN DOWN", 3];
} else {
titleText ["YOU ARE ENTERING THE DONATOR CITY, SPECIAL ACCESS ONLY!", "PLAIN DOWN", 3];
sleep 5;
titleText ["TURN BACK NOW OR YOU WILL BE TELEPORTED!", "PLAIN DOWN", 3];
sleep 5;
titleText ["YOU WERE WARNED...!", "PLAIN DOWN", 3];
sleep 5;

player setPosATL [7767.9873, 3506.2898,0];

waitUntil {! (vehicle player in list _Basis)};
titleText ["HAVE A NICE DAY!.", "PLAIN DOWN", 3];
};
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Try

if ((getPlayerUID player) in ["####","#####","#####"]) then {
titleText ["WELCOME BACK TO THE DONATOR CITY! ENJOY YOUR STAY!", "PLAIN DOWN", 3];
} else {
titleText ["YOU ARE ENTERING THE DONATOR CITY, SPECIAL ACCESS ONLY!", "PLAIN DOWN", 3];
sleep 5;
titleText ["TURN BACK NOW OR YOU WILL BE TELEPORTED!", "PLAIN DOWN", 3];
sleep 5;
titleText ["YOU WERE WARNED...!", "PLAIN DOWN", 3];
sleep 5;

player setPosATL [7767.9873, 3506.2898,0];

waitUntil {! (vehicle player in list _Basis)};
titleText ["HAVE A NICE DAY!.", "PLAIN DOWN", 3];
};

Replace "#####" with the UID's.Ex. "12345","54321",ect

Link to comment
Share on other sites

  • 0

Try

if ((getPlayerUID player) in ["####","#####","#####"]) then {
titleText ["WELCOME BACK TO THE DONATOR CITY! ENJOY YOUR STAY!", "PLAIN DOWN", 3];
} else {
titleText ["YOU ARE ENTERING THE DONATOR CITY, SPECIAL ACCESS ONLY!", "PLAIN DOWN", 3];
sleep 5;
titleText ["TURN BACK NOW OR YOU WILL BE TELEPORTED!", "PLAIN DOWN", 3];
sleep 5;
titleText ["YOU WERE WARNED...!", "PLAIN DOWN", 3];
sleep 5;

player setPosATL [7767.9873, 3506.2898,0];

waitUntil {! (vehicle player in list _Basis)};
titleText ["HAVE A NICE DAY!.", "PLAIN DOWN", 3];
};

Replace "#####" with the UID's.Ex. "12345","54321",ect

This should work. I'd just like to add never use global variables for anything you want to be secure, global variables can be changed by a hacker.

Link to comment
Share on other sites

  • 0

nope did not work

 

when i remove my self from the list and try to get in

after 4 times it let me in

 

First time when i try i see this in my screen

YOU ARE ENTERING THE DONATOR CITY, SPECIAL ACCESS ONLY!

TURN BACK NOW OR YOU WILL BE TELEPORTED!

YOU WERE WARNED...!

 

Second time i try

TURN BACK NOW OR YOU WILL BE TELEPORTED!

YOU WERE WARNED...!

 

and the third time i try i see

YOU WERE WARNED...!

 

and 4e time nothing i can just walk there and im not getting teleported away

Link to comment
Share on other sites

  • 0

Well.. what I can see missing from your last post is this 

waitUntil {! (vehicle player in list _Basis)};
titleText ["HAVE A NICE DAY!.", "PLAIN DOWN", 3];
};

That means the waitUntil is broken? probably the 'list' command. Rewrite it to take account for the basis like this maybe.. or make an array containing all the basis and then you could just call the in on that.

waitUntil {((!(vehicle player in _Base1)) || (!(vehicle player in _Base2)))};
Link to comment
Share on other sites

  • 0

Here is all of the code i use

 

donateList

i have that in my init.sqf

donateList = ["UID HERE"];

 

 

and this

 

//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player allowDamage true;
  }

 

 

Link to comment
Share on other sites

  • 0

 

Here is all of the code i use

 

donateList

i have that in my init.sqf

donateList = ["UID HERE"];

and this

//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player allowDamage true;
  }

What calls this file, is it called by a trigger? if so what is the code for the trigger and conditions.

 

EDIT: also change while {true} to while {1==1}

 

EDIT 2: found the original post http://opendayz.net/threads/safe-zone-with-god-mode-for-all-players.12237/

 

EDIT 3: you should be able to fix this by creating a trigger for each side playable. In other words change your code to this.

    class Sensors
{
        items=2;
        class Item0
        {
            position[]={13199.9,0.002,16651.4};
            a=150;
            b=150;
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            text="Basis_West";
            name="Basis_West";
            expActiv="if (playerSide == WEST) then {[Basis_West] execVM ""safezone.sqf""};";
            class Effects
            {
            };
        };
        class Item1
        {
            position[]={13199.9,0.002,16651.4};
            a=150;
            b=150;
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            text="Basis_East";
            name="Basis_East";
            expActiv="if (playerSide == EAST) then {[Basis_East] execVM ""safezone.sqf""};";
            class Effects
            {
            };
        };
};

NOTE: you need to change the positions to the positions of your safezone, both positions are the same.

Link to comment
Share on other sites

  • 0

Basically, it looks like you are not teleporting the player far enough away for him to be outside of the trigger, thus the waitUntil condition is never satisfied until he leaves under his own volition. 

You'll simply need to teleport the player further away, the radius I'm assuming is the default 150m. Otherwise you can shrink the radius.

Link to comment
Share on other sites

  • 0

What i do for my donation areas is setting up a sensor for each zone like this

class ItemNN
{
	position[]={440.62,0,4579.59};
	a=100;
	b=100;
	activationBy="ANY";
	repeating=1;
	interruptable=1;
	age="UNKNOWN";
	name="adminDome";
	expCond="(vehicle player) in thislist;";
	expActiv="dome = [] execVM ""donation\donatorsDome.sqf"";";
	expDesactiv="terminate dome; titleText [""Goodbye"", ""PLAIN DOWN"", 3];";
	class Effects
	{
	};
};

here is a few things to notice

 

"ItemNN" you need to change to the next number in your sensor line like "Item22" and change the total number at the start of "Class Sensors"

 

position[]={440.62,0,4579.59};

 

440.62 = distance west to east in meters (x)

0 = height (z)

4579.59 = distance from south to north in meters (y)

(This is important to note the order of since it will change for the next part)

 

'a' and 'b' is the size of the area from the coords in meters (radius)

 

 

'name' is a unique name for that sensor. so ONLY this sensor can have this name

 

expActiv="dome = [] execVM ""donation\donatorsDome.sqf"";";

pretty much explains itself, but just in case, this is what script to execute where "donation" is a folder in your mission file root.

 

titleText [""Goodbye"", ""PLAIN DOWN"", 3];

Goodbye = change to what ever exit text you want

PLAIN DOWN = don't touch!

3 = timeout, how long time the text will show in sec.

 

 

So now for the next part, the script we want to run if some one get inside the dome

private ["_location","_pAccess","_distanceMin","_distanceMax","_airHeight","_movPos","_v"]

_location = [x,y,z];
_pAccess = ["0","0"];
_distanceMin = 150;
_distanceMax = 500;
_airHeight = 400;

if ((getPlayerUID player) in _pAccess) then {
  titleText ["Welcome to your plot!", "PLAIN DOWN", 3];
} else {
  titleText ["You are not allowed here ... You got 8 sec to leave", "PLAIN", 2];
  sleep 2;
  titleText ["Leave this place now ... Teleporting in 4sec!", "PLAIN DOWN", 2];
  sleep 2;
  titleText ["4 sec to leave ...", "PLAIN DOWN", 2];
  sleep 2;
  titleText ["Teleporting...", "PLAIN DOWN", 2];
  sleep 2;
  _v = vehicle player;
  if(_v isKindOf "air") then {
    _movPos = [_location, _distanceMin, _distanceMax, 10, 0, 20, 0] call BIS_fnc_findSafePos;
    _movPos set [2, _airHeight]
  } else {
    _movPos = [_location, _distanceMin, _distanceMax, 10, 0, 20, 0] call BIS_fnc_findSafePos;
  };
  _v setpos _movPos;
  titleText ["Dont go back there please!", "PLAIN", 3];
};

Save this in the folder and as the name you want (i call mine donatorsDome.sqf, donatorsDome2.sqf and so on)

 

Now edit the _location with the coords you used in the sensor. You remember that the order for the sensor was [x,z,y]? thats NOT the order we are using here, here we use [x,y,z],

then edit the _pAccess and add the PlayerUID's you want to have access to that particular dome, maybe change some text to what you want it to say.

 

 

_location = [x,y,z]   This you want the same as the sensor coords, just remember the order for this location is "x,y,z" and not "x,z,y" as the sensor class (i always use '0' for height (z) )
_pAccess = ["0","0"]; PlayerUID's
_distanceMin = 150; Distance from '_location' players as a minimum will be TP'ed away in any direction
_distanceMax = 500; Distance from '_location' players as a maximum will be TP'ed away in any direction (so with this setup some where between 150-500 meters away form the coord which is fine as my 'a' and 'b' only are set to 100 meters
_airHeight = 400; if player is in 'Air' vehicle they will also be tp'ed 400 meters above ground change this to your liking

 

Now you are ready. Repeat process for each dome

 

The script will TP the player if on foot and vehicle and passengers (if player is in a vehicle and have passengers) minimum 150 and maximum 500 meters away from the coordinate on the ground if in a non 'Air' vehicle. If in air it's the same just 400 meters above ground. This way no one can use it as a fast TP to a trader or another specific area. The script will choose a safe location within the limits you have set in any direction.

 

Timer from activation till TP is 8 sec.

Link to comment
Share on other sites

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...