Radiix Posted August 31, 2013 Report Share Posted August 31, 2013 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 More sharing options...
MGT Posted August 31, 2013 Report Share Posted August 31, 2013 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 More sharing options...
Radiix Posted August 31, 2013 Author Report Share Posted August 31, 2013 Hey dave, yes i forgot about that thanks for the hint. I'll take a deeper look into this when i get back from work. Link to comment Share on other sites More sharing options...
Kind-Sir Posted August 31, 2013 Report Share Posted August 31, 2013 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.sqfGo 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 functionsAND 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. Radiix 1 Link to comment Share on other sites More sharing options...
MGT Posted August 31, 2013 Report Share Posted August 31, 2013 ^^ Testing this now, will report on findings. Edit, it works :) Link to comment Share on other sites More sharing options...
maca134 Posted August 31, 2013 Report Share Posted August 31, 2013 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 More sharing options...
MGT Posted August 31, 2013 Report Share Posted August 31, 2013 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 More sharing options...
Kind-Sir Posted August 31, 2013 Report Share Posted August 31, 2013 Comment out every line with "//" or just "//" on the first line?Surround the code with /* */So, for example:/*if (!isNil "_mylastPos") then { -snip- };*/I recommend Notepad++ and setting the code highlighting to C to easily see what is commented out. maca134 1 Link to comment Share on other sites More sharing options...
maca134 Posted August 31, 2013 Report Share Posted August 31, 2013 Surround the code with /* */ So, for example: /*if (!isNil "_mylastPos") then { -snip- };*/ I recommend Notepad++ and setting the code highlighting to C to easily see what is commented out. Link to comment Share on other sites More sharing options...
MGT Posted August 31, 2013 Report Share Posted August 31, 2013 Instead of commenting out, I just changed the values and it's working, no complaints tonight. Kind-Sir 1 Link to comment Share on other sites More sharing options...
Radiix Posted September 2, 2013 Author Report Share Posted September 2, 2013 Hey guys, first of all i can't tell how i appreciate everyone for the massive help i got with the code. I'll test it out by changing the values as MGT suggested. Link to comment Share on other sites More sharing options...
Radiix Posted September 2, 2013 Author Report Share Posted September 2, 2013 Alright everything works fine. Thank you again guys, you are truly amazing :) Link to comment Share on other sites More sharing options...
timothypaul26 Posted September 12, 2013 Report Share Posted September 12, 2013 @MGT, What values did you change? And what did you change them to? Link to comment Share on other sites More sharing options...
timothypaul26 Posted September 13, 2013 Report Share Posted September 13, 2013 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 More sharing options...
MGT Posted September 13, 2013 Report Share Posted September 13, 2013 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 More sharing options...
Armifer Posted September 20, 2013 Report Share Posted September 20, 2013 Just add logic to filter our your admins from those position checks. That way you are protected against hackers somewhat, and can use your tools too. Link to comment Share on other sites More sharing options...
DrS8n Posted September 28, 2013 Report Share Posted September 28, 2013 What about the other admin tools like spawning vehicles and such, anytime i spawn one in with admin tools it explodes. Link to comment Share on other sites More sharing options...
Achmed Posted September 28, 2013 Report Share Posted September 28, 2013 Thats prob the cleanup script not configured correctly Link to comment Share on other sites More sharing options...
DrS8n Posted September 28, 2013 Report Share Posted September 28, 2013 Thats prob the cleanup script not configured correctly No its not that, it happens in the latest Epoch when you spawn in items like static launchers too, you go to use them and you instantly die! Link to comment Share on other sites More sharing options...
Torndeco Posted September 28, 2013 Report Share Posted September 28, 2013 @ DrS8n Its your server cleanup code. Server notices the vehicle u are in is not in dayz_serverObjectMonitor. Since u spawned it in using admin tools & didn't add it to dayz_serverObjectMonitor. Server kills u. Check the rpt logs & u will see a log about killing a hacker Link to comment Share on other sites More sharing options...
DrS8n Posted September 28, 2013 Report Share Posted September 28, 2013 Thanks Torndeco, I adjusted the file and its working great! Link to comment Share on other sites More sharing options...
GetCrazy Gaming Posted October 12, 2013 Report Share Posted October 12, 2013 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 More sharing options...
prue420 Posted October 16, 2013 Report Share Posted October 16, 2013 Did you ever figure out what file we need to edit for the fix? Link to comment Share on other sites More sharing options...
fr1nk Posted October 16, 2013 Report Share Posted October 16, 2013 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 More sharing options...
prue420 Posted October 16, 2013 Report Share Posted October 16, 2013 My admin tools all work now but since i put it on my vehicle locations don't save after a restart they go back to there original location. I think its something in the server cleanup any help? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now