Jump to content

[How To] Disable the 1.0.2 Anti-TP protection


Radiix

Recommended Posts

 I Go through this thread and you will find everything you need. Thanks to all people that contributed to that fix!

 I

 I

 I

 I

 I

 I

 I

V

 

 

First of all, this protection was meant to stop all the scriptkids using teleporthacks on your server.

 

When you disable this protection, all scriptkids with poor hacks will be able to TP around on your server. Keep that in mind!

I take no credits for that!

 

 

1. Extract your dayz_code.pbo in @DayZ_Epoch with cpbo, or PBO-Manager

2. Go to the folder /systems/

3. Open the sqf file called "player_spawn_2.sqf"

 

Search for that code around line 269:

_myPos = player getVariable["lastPos",[]];
if (count _myPos > 0) then {
player setVariable["lastPos",_mylastPos, true];
player setVariable["lastPos",[]];
};
 
_lastPos = getPosATL player; 
if (!isNil "_mylastPos") then {
if (player == vehicle player) then {
if (_mylastPos distance _lastPos > 200) then {
if (alive player) then {
player setPosATL _mylastPos;
};
};
} else {
if (_mylastPos distance _lastPos > 800) then {
if (alive player) then {
player setPosATL _mylastPos;
};
};
};
};
Link to comment
Share on other sites

Yes, that would be ideal, however you're forgetting an important issue. This is in the client files on the server, the very same client files that each player that connects to your server has. They download from DayZ Commander or direct from here and it doesn't have that fix. If the clients don't have the same player spawn code the server won't run, at best it will error out. The only possible temporary fix would be to move that to the mission file and call it from the init, but I think Arma code won't allow that and it will error.

Link to comment
Share on other sites

Since this is declared within compiles.sqf, you could over-write the variable on the same level (when loading the mission) with a custom compiles.sqf line.

You will need to do the following:

Open up your mission.pbo file, create a dayz_code folder, and within that, create both an init and system folder.

Within the init folder, make a new text file, and rename it to compiles.sqf

Go into compiles.sqf and put the following:

if (!isDedicated) then {
    player_spawn_2 = compile preprocessFileLineNumbers "dayz_code\system\player_spawn_2.sqf";
};
Then go into your dayz_code/system folder and then copy the dayz_code.pbo/system/player_spawn_2.sqf into your mission's dayz_code/system directory, then edit it according to the first post (modifying the lines specified).

Now go into your mission's init.sqf file, and search for the line:

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";				//Compile regular functions
AND ADD AFTER THAT:

call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";
I tested this out by modifying the code specified in the first post in order to stop teleporting people when they desync in a heli, this has NOT been tested out with a teleport script.
Link to comment
Share on other sites

This will should (confirmed) work, just comment out this bit:

if (!isNil "_mylastPos") then {
if (player == vehicle player) then {
if (_mylastPos distance _lastPos > 200) then {
if (alive player) then {
player setPosATL _mylastPos;
};
};
} else {
if (_mylastPos distance _lastPos > 800) then {
if (alive player) then {
player setPosATL _mylastPos;
};
};
};
};
Link to comment
Share on other sites

 

This will should work, just comment out this bit:

if (!isNil "_mylastPos") then {
if (player == vehicle player) then {
if (_mylastPos distance _lastPos > 200) then {
if (alive player) then {
player setPosATL _mylastPos;
};
};
} else {
if (_mylastPos distance _lastPos > 800) then {
if (alive player) then {
player setPosATL _mylastPos;
};
};
};
};

 

Comment out every line with "//" or just "//" on the first line?

Link to comment
Share on other sites

  • 2 weeks later...

I assume you're just changing the 800 to 20000, as you stated in the other thread? Will this fix the admin TP issue too? Or is there another fix seperate of that? I guess I'd be more interested in the admin TP issue. I seen other threads on it, but did not see any posts on what to fix for the admin TP issue. Sorry I know I'm a noob, any help would be greatly appreciated.

Link to comment
Share on other sites

change the 200 to whatever you're happy with teleporting up to in 1 jump in metres, bearing in mind that you open the door to hackers who wish to teleport players, and change the 800 to 2000 or so as that I believe is regarding vehicle travel distance.

Link to comment
Share on other sites

  • 2 weeks later...

I must have missed something... There are several "fixes" on this thread. But i cant tell whos confirming which ones. Not only that, but i cannot even find the "player_spawn_2.sqf" file in either my mission or server folder. Can someone PLEASE reply and tell me exactly which one of the many "fixes" works. And exactly where it is im supposed to go to add/change/remove said "fix"?

Link to comment
Share on other sites

I must have missed something... There are several "fixes" on this thread. But i cant tell whos confirming which ones. Not only that, but i cannot even find the "player_spawn_2.sqf" file in either my mission or server folder. Can someone PLEASE reply and tell me exactly which one of the many "fixes" works. And exactly where it is im supposed to go to add/change/remove said "fix"?

 

Post # 1 for location of player_spawn_2.sqf

Post # 4 for steps to load via mission.pbo

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