Files
DayZ-Epoch/SQF/dayz_code/system/antihack.sqf
ebaydayz 4bd9a9aa0b Update public variables
It makes no sense to rename the identical DayZ PVs to have an E in their
name. I don't see any good reason it was done in the first place. All it
accomplishes is breaking script compatibility between the two mods and
requiring different publicvariable.txt filters. The only time it makes
sense is for custom Epoch variables that aren't used in vanilla.

All admins have to do to update custom scripts is swap the names
according to the change log.

Note I've submitted a pull request to replace PVDZ_veh_Save with
PVDZ_obj_Save in official too because they are duplicates.
2016-03-18 21:39:22 -04:00

123 lines
4.2 KiB
Plaintext

/* Block local script execution bug. Still not fixed in A20A as of 1.63.131129 */
inGameUISetEventHandler ["PrevAction","false"];
inGameUISetEventHandler ["NextAction","false"];
inGameUISetEventHandler ["Action","false"];
/*
Anti-Teleport - Created By Razor / Refactored By Alby & CopyPasted to Epoch by Skaronator
*/
/* Moved to scheduled security
private ["_log","_playerName","_playerUID","_PUID","_al1veOnce","_debug","_lastpos","_lastheight","_lasttime","_lastVehicle","_v","_h","_topv","_toph","_curpos","_distance","_acceptableDistance","_curtime","_difftime","_plant","_curheight","_speed","_topSpeed","_terrainHeight","_differenceCheck","_lastPosVar","_safetyVehicle","_curPos"];
waitUntil {vehicle player == player};
[] spawn {
private ["_playerName","_playerUID"];
_playerName = name player;
_playerUID = [player] call FNC_GetPlayerUID;
while {1 == 1} do {
if (typeName player != "OBJECT") then {
PVDZE_atp = format["WARNING typename error for player UID#%1", _playerUID];
publicVariableServer "PVDZE_atp";
//forceEnd;
endMission "LOSER";
uiSleep 10; //Bypass spam
};
};
endMission "LOSER";
};
[] spawn {
_playerName = name player;
_playerUID = [player] call FNC_GetPlayerUID;
while {true} do {
uiSleep 5;
};
PVDZE_atp = format["WARNING PLAYER WITH NAME (%1) && UID# (%2) HAS CHANGED THE TRUE VALUE TO FALSE", _playerName, _playerUID];
publicVariableServer "PVDZE_atp";
endMission "LOSER";
uiSleep 10;
};
[] spawn {
_al1veOnce = false;
if (!_al1veOnce) then {
private [ "_loc", "_plant","_debug"];
_debug = getMarkerpos "respawn_west";
// check that plants libs are properly loaded
// thanks to Tansien the great
// run only once per character life
{
_plant = _x createVehicleLocal _debug;
uiSleep 0.1;
if (sizeOf _x == 0) exitWith {
PVDZE_atp = "Plants texture hack for type " + _x;
publicVariableServer "PVDZE_atp";
endMission "LOSER";
};
deleteVehicle _plant;
} count ["grass", "prunus", "picea", "fallentree", "phragmites", "acer", "amygdalusn", "Brush", "fiberplant", "amygdalusc", "boulder"];
diag_log format [ "%1: Plants libs tests done!", __FILE__];
};
_al1veOnce = true;
};
while {1 == 1} do {
_debug = getMarkerpos "respawn_west";
_lastpos = getPosATL (vehicle player);
_lastheight = (ATLtoASL _lastpos) select 2;
_lasttime = diag_ticktime;
_lastVehicle = vehicle player;
// freefall detection:
_v = 0;
_h = 0;
_topv = 0;
_toph = 0;
while {((typeName player == "OBJECT") && {((player in playableUnits) || {(alive player)})})} do {
_curpos = getPosATL (vehicle player);
_distance = _lastpos distance _curpos;
_curtime = diag_ticktime;
_difftime = _curtime - _lasttime;
_acceptableDistance = if (_lastVehicle isKindOf "Plane") then [{15},{10}];
if ((_distance > _acceptableDistance) || {(_difftime > 1)}) then {
_curheight = (ATLtoASL _curpos) select 2;
_speed = _distance / _difftime;
_topSpeed = if (_acceptableDistance == 15) then { 20; } else { 10; };
if (vehicle player != player) then {
if (_acceptableDistance == 15) then {
_topSpeed = (getNumber (configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "maxSpeed")) max 500;
} else {
_topSpeed = (getNumber (configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "maxSpeed")) min 500;
};
};
_terrainHeight = getTerrainHeightASL [_curpos select 0, _curpos select 1];
_safetyVehicle = vehicle player;
if (_lastVehicle == vehicle player) then {
if ((_speed > _topSpeed) && (alive player) && ((driver (vehicle player) == player) || (isNull (driver (vehicle player)))) && (_debug distance _lastpos > 3000) && !((vehicle player == player) && (_curheight < _lastheight) && ((_curheight - _terrainHeight) > 1))) then {
(vehicle player) setposATL _lastpos;
_PUID = [player] call FNC_GetPlayerUID;
PVDZE_atp = format["TELEPORT REVERT for player UID#%1 from %2 to %3, %4 meters, now at %5", _PUID, _lastpos, _curPos, round(_lastpos distance _curpos), getPosATL player];
publicVariableServer "PVDZE_atp";
} else {
_lastpos = _curpos;
_lastheight = _curheight;
};
_lasttime = _curtime;
};
if (_safetyVehicle == vehicle player) then {
_lastVehicle = vehicle player;
};
};
uiSleep 0.25;
};
uiSleep 0.1;
};
endMission "LOSER";
*/