Kick people out of bounds?

arebokert

New Member
Hi!

I am just wondering, would it be possible to kick or warn people that are moving out of the map in to the debug zone? I have found scripts that warn people about being in a specific area, but I want to warn everyone going outside of the map. Would this be possible?

Best regards!
 
Code:
while {alive player} do {
 
_charPos =            getPosATL (vehicle player);
_nearSpawnPos =    ((dayz_spawnPos distance _charPos) < 100);
_xCoord =            _charPos select 0;
_yCoord =            _charPos select 1;
 
if ((_xCoord > 14960 and _xCoord < 15060 or _xCoord < 400 and _xCoord > 300 or _yCoord > 14960 and _yCoord < 15060 or _yCoord < 400 and _yCoord > 300) and !_nearSpawnPos) then {
    cutText ["You're less than 400m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];
};
 
if ((_xCoord > 15060 and _xCoord < 15160 or _xCoord < 300 and _xCoord > 200 or _yCoord > 15060 and _yCoord < 15190 or _yCoord < 300 and _yCoord > 200) and !_nearSpawnPos) then {
    cutText ["You're less than 300m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];
};
 
if ((_xCoord > 15160 and _xCoord < 15260 or _xCoord < 200 and _xCoord > 100 or _yCoord > 15160 and _yCoord < 15290 or _yCoord < 200 and _yCoord > 100) and !_nearSpawnPos) then {
    cutText ["You're less than 200m from the debug area. Turn around!", "PLAIN DOWN"];
};
 
if ((_xCoord > 15260 or _xCoord < 100 or _yCoord > 15260 or _yCoord < 100) and !_nearSpawnPos) then {
    cutText ["You're less than 100m from the debug area. You will be killed if you cross the debug line!", "PLAIN DOWN"];
};
 
sleep 3;
 
};

You can trigger the player kill/break his legs/make him dance or whatever via server_playerSync.
Of course the coords are for Chernarus.
 
Hah, I have it set up around the entire contours of Celle, so that you have X amount of time to return the map or you get killed. PRetty much using the exact same thing as cyrq has mentioned
 
Code:
while {alive player} do {
 
_charPos =            getPosATL (vehicle player);
_nearSpawnPos =    ((dayz_spawnPos distance _charPos) < 100);
_xCoord =            _charPos select 0;
_yCoord =            _charPos select 1;
 
if ((_xCoord > 14960 and _xCoord < 15060 or _xCoord < 400 and _xCoord > 300 or _yCoord > 14960 and _yCoord < 15060 or _yCoord < 400 and _yCoord > 300) and !_nearSpawnPos) then {
    cutText ["You're less than 400m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];
};
 
if ((_xCoord > 15060 and _xCoord < 15160 or _xCoord < 300 and _xCoord > 200 or _yCoord > 15060 and _yCoord < 15190 or _yCoord < 300 and _yCoord > 200) and !_nearSpawnPos) then {
    cutText ["You're less than 300m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];
};
 
if ((_xCoord > 15160 and _xCoord < 15260 or _xCoord < 200 and _xCoord > 100 or _yCoord > 15160 and _yCoord < 15290 or _yCoord < 200 and _yCoord > 100) and !_nearSpawnPos) then {
    cutText ["You're less than 200m from the debug area. Turn around!", "PLAIN DOWN"];
};
 
if ((_xCoord > 15260 or _xCoord < 100 or _yCoord > 15260 or _yCoord < 100) and !_nearSpawnPos) then {
    cutText ["You're less than 100m from the debug area. You will be killed if you cross the debug line!", "PLAIN DOWN"];
};
 
sleep 3;
 
};

You can trigger the player kill/break his legs/make him dance or whatever via server_playerSync.
Of course the coords are for Chernarus.

Thank you very much! I am assuming I should put this in dayz_server.pbo in server_playersync.sqf? I am kind of new to Arma 2 scripting.
 
Well, my best guess it to execute it client side in your init.sqf.
Code:
[] execVM "ilikecookies\getthefuckbackonthemapdumbass.sqf";
That's simply a text that will be displayed to the player if he passes the specified coords.
If you want to kill the player (or whatever) I would suggest looking into DayZRedux code (server_playerSync.sqf)
 
Thank you both for answering, I appreciate it. So just to be 100% sure, I create the file outofbounds.sqf. I put this in the folder scripts. Outside of the folder scripts I have my init.sqf by default. I use execVM to execute the scripts/outofbounds.sqf for all players, correct? Just one last question. If I just want to kick a player for entering the debug zone, I won't have to use server_playersync.sqf, right? I'm just assuming this due to the kicking process being handled by battleeye. Anyway, if I want to kick a player after the last message, what do I use, and if I want to kick him after 30 seconds, how do I do that? I'm guessing something like this.

Code:
while {alive player} do {

_charPos =            getPosATL (vehicle player);

_nearSpawnPos =    ((dayz_spawnPos distance _charPos) < 100);

_xCoord =            _charPos select 0;

_yCoord =            _charPos select 1;

if ((_xCoord > 15260 or _xCoord < 100 or _yCoord > 15260 or _yCoord < 100) and (!_nearSpawnPos) and (_check == "1")) then {

        //Insert kick code here.

        _check = "0";

} else {
        _check = "0";
};

if ((_xCoord > 14960 and _xCoord < 15060 or _xCoord < 400 and _xCoord > 300 or _yCoord > 14960 and _yCoord < 15060 or _yCoord < 400 and _yCoord > 300) and !_nearSpawnPos) then {

    cutText ["You're less than 400m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];

};

if ((_xCoord > 15060 and _xCoord < 15160 or _xCoord < 300 and _xCoord > 200 or _yCoord > 15060 and _yCoord < 15190 or _yCoord < 300 and _yCoord > 200) and !_nearSpawnPos) then {

    cutText ["You're less than 300m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];

};

if ((_xCoord > 15160 and _xCoord < 15260 or _xCoord < 200 and _xCoord > 100 or _yCoord > 15160 and _yCoord < 15290 or _yCoord < 200 and _yCoord > 100) and !_nearSpawnPos) then {

    cutText ["You're less than 200m from the debug area. Turn around!", "PLAIN DOWN"];

};

if ((_xCoord > 15260 or _xCoord < 100 or _yCoord > 15260 or _yCoord < 100) and !_nearSpawnPos) then {

    cutText ["You're less than 100m from the debug area. You will be kick if you do not turn back in 30 seconds!", "PLAIN DOWN"];

    _check = "1";

    sleep 30;

};

sleep 3;

};

Will that work? I've never used C++ before, but I have used other programming languages so I have some degree of understanding of programming in general. I'm just not sure if I'm declaring and setting the variables correctly.
 
You can't kick a player from the server via a sqf file. You can probably somehow force end his mission but i don't know how to do it.
Also the idea is illogical.
Lets say I would go 200m behind the debug line. Every time I would connect to the server I'd be kicked since my last pos was already synched.:confused:
Kill the player - problem solved :D
 
So my version is ok as long as I slay the player, correct? Is it possible to slay the player in this script? I found a script that teleports the player up in the air and when they hit the ground they die from fall damage.

Code:
while {alive player} do {
 
_charPos =            getPosATL (vehicle player);
 
_nearSpawnPos =    ((dayz_spawnPos distance _charPos) < 100);
 
_xCoord =            _charPos select 0;
 
_yCoord =            _charPos select 1;
 
if ((_xCoord > 15260 or _xCoord < 100 or _yCoord > 15260 or _yCoord < 100) and (!_nearSpawnPos) and (_check == "1")) then {
       
        _dir = getdir vehicle player;
        _pos = getPos vehicle player;
        _pos = [(_pos select 0)-10*sin(_dir),(_pos select 1)-10*cos(_dir),55];
        v setPos _pos;
 
        _check = "0";
 
} else {
        _check = "0";
};
 
if ((_xCoord > 14960 and _xCoord < 15060 or _xCoord < 400 and _xCoord > 300 or _yCoord > 14960 and _yCoord < 15060 or _yCoord < 400 and _yCoord > 300) and !_nearSpawnPos) then {
 
    cutText ["You're less than 400m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];
 
};
 
if ((_xCoord > 15060 and _xCoord < 15160 or _xCoord < 300 and _xCoord > 200 or _yCoord > 15060 and _yCoord < 15190 or _yCoord < 300 and _yCoord > 200) and !_nearSpawnPos) then {
 
    cutText ["You're less than 300m from the debug area. We strongly suggest not to go there!", "PLAIN DOWN"];
 
};
 
if ((_xCoord > 15160 and _xCoord < 15260 or _xCoord < 200 and _xCoord > 100 or _yCoord > 15160 and _yCoord < 15290 or _yCoord < 200 and _yCoord > 100) and !_nearSpawnPos) then {
 
    cutText ["You're less than 200m from the debug area. Turn around!", "PLAIN DOWN"];
 
};
 
if ((_xCoord > 15260 or _xCoord < 100 or _yCoord > 15260 or _yCoord < 100) and !_nearSpawnPos) then {
 
    cutText ["You're less than 100m from the debug area. You will be kick if you do not turn back in 30 seconds!", "PLAIN DOWN"];
 
    _check = "1";
 
    sleep 30;
 
};
 
sleep 3;
 
};
 
You're complicating this way too much...
I've gave you the exact source to search for the code. Y U no reading?:eek:
https://github.com/Venthos/DayZRedu...ons/dayz_server/compile/server_playerSync.sqf

From line 58:
Code:
_nearDebug = ((_debug distance _charPos) < 1500);
_isAlive = alive _character;
_nearSpawnPos = ((dayz_spawnPos distance _charPos) < 100);
_xCoord = _charPos select 0;
_yCoord = _charPos select 1;
 
if (_nearDebug) exitWith {
    diag_log format["ERROR: Refusing playerSync %1 since they're near debug (%2)", name _character, _charPos];
};
if (!_isAlive) exitWith {
    diag_log format["ERROR: Refusing playerSync %1 since they're dead (%2)", _character, _charPos];
};
if ((_xCoord > 15360 or _xCoord < 0 or _yCoord > 15360 or _yCoord < 0) and !_nearDebug and !_nearSpawnPos) then {
    _character allowDamage true;
    _character setDamage 1;
    diag_log format["OUTOFBOUNDS: Killing player %1 since they're out of bounds (%2)", name _character, _charPos];
    if (_isInVehicle) then {
        (vehicle _character) allowDamage true;
        (vehicle _character) setDamage 1;
        diag_log format["OUTOFBOUNDS: Killing vehicle %1 since it's out of bounds (%2)", typeOf(vehicle _character), _charPos];
    };
};
 
You're complicating this way too much...
I've gave you the exact source to search for the code. Y U no reading?:eek:
https://github.com/Venthos/DayZRedux/blob/master/ArmA Directory/@Hive/Addons/dayz_server/compile/server_playerSync.sqf

From line 58:
Code:
_nearDebug = ((_debug distance _charPos) < 1500);
_isAlive = alive _character;
_nearSpawnPos = ((dayz_spawnPos distance _charPos) < 100);
_xCoord = _charPos select 0;
_yCoord = _charPos select 1;
 
if (_nearDebug) exitWith {
    diag_log format["ERROR: Refusing playerSync %1 since they're near debug (%2)", name _character, _charPos];
};
if (!_isAlive) exitWith {
    diag_log format["ERROR: Refusing playerSync %1 since they're dead (%2)", _character, _charPos];
};
if ((_xCoord > 15360 or _xCoord < 0 or _yCoord > 15360 or _yCoord < 0) and !_nearDebug and !_nearSpawnPos) then {
    _character allowDamage true;
    _character setDamage 1;
    diag_log format["OUTOFBOUNDS: Killing player %1 since they're out of bounds (%2)", name _character, _charPos];
    if (_isInVehicle) then {
        (vehicle _character) allowDamage true;
        (vehicle _character) setDamage 1;
        diag_log format["OUTOFBOUNDS: Killing vehicle %1 since it's out of bounds (%2)", typeOf(vehicle _character), _charPos];
    };
};
I'm very sorry for not looking in to DayZRedux. The reason I didn't is that I didn't understand what you meant by DayZRedux, I didn't realize that it was a server source. Now I also understand what you meant by server_playersync.sqf. Thank you very much for your help, and you to Manatee Hunter. If I encounter any problems I'll come back in shame, but your instructions were so helpful so I don't think that'll be necessary.

Thank you! :)
 
this script not function on version 1.7.7 from Redux code.
I have server with mod @DayZ - classic server
Some one help?
 
no solution for version dayz 1.7.7.1? this is best script for 1.7.6.1 bud dont work for new version. is some one agle to rewrite redux script??

thanks for help
 
Something changed in 1.7.7.1 and dayz_spawnPos is removed or replaced or not working.
Quick and dirty fix:

Code:
_nearDebug = ((_debug distance _charPos) < 1500);
_isAlive = alive _character;
_xCoord = _charPos select 0;
_yCoord = _charPos select 1;
 
if (_nearDebug) exitWith {
    diag_log format["ERROR: Refusing playerSync %1 since they're near debug (%2)", name _character, _charPos];
};
if (!_isAlive) exitWith {
    diag_log format["ERROR: Refusing playerSync %1 since they're dead (%2)", _character, _charPos];
};
if ((_xCoord > 15360 or _xCoord < 0 or _yCoord > 15360 or _yCoord < 0) and !_nearDebug) then {
    _character allowDamage true;
    _character setDamage 1;
    diag_log format["OUTOFBOUNDS: Killing player %1 since they're out of bounds (%2)", name _character, _charPos];
    if (_isInVehicle) then {
        (vehicle _character) allowDamage true;
        (vehicle _character) setDamage 1;
        diag_log format["OUTOFBOUNDS: Killing vehicle %1 since it's out of bounds (%2)", typeOf(vehicle _character), _charPos];
    };
};
 
Back
Top