Jump to content
  • 0

Fixing the damn Vein-Duping-Glitch


grafzahl

Question

Hey Guys,

 

we realy have a big problem, i dont know why nobody seemed to ask this before but maybe you do know, that when you deconstruct the Vein-Wrecks (Iron, Silver, Gold, it doesnt count), its only client-side, all other clients except yours, still sees the Vein-Wreck and can deconstruct it a second time. So if a group of 5 guys finds a gold-vein, each one of them can deconstruct the vein and get the gold ore... so sometimes groups can get like 100 Gold from one Vein.

 

Its a big issue because it ruins the whole economy on our server, giving the big clans the most money.

 

But lets get to the "How its done", i know its done in the actions/remove.sqf, i do the following after one player has reached the proceed state but its not working, all other players still see the Vein-Wrecks.

		deleteVehicle _obj;

		PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
		publicVariableServer "PVDZE_obj_Delete";
		PVDZE_obj_Hide = _obj;
		publicVariable "PVDZE_obj_Hide";

So, i know it has to be done on all Clients, but i thought i can simply "hide" the Object on all clients.

The only other option i see is to set a Variable on the Wreck when its been removed, and to check for the variable on each remove-request, so the vein cant be removed twice. But a better solution would be to get it cleaned up on all clients after the remove.

Btw: If you remove a vein-wreck, and the second client relogs, the wreck is gone on his client - But as long as the other clients stay in-game, the wreck is still there.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Ok, nevermind, solved it myself...

 

If anyone wants to know: I added a check for nearestplayer inside the remove.sqf, so only one player at a time can deconstruct something. Then i added a new publicvariableHandler that fires when you finished to deconstruct a vein, it searches for the veine wreck on every client and deletes it on all clients. In my tests everything worked fantastic, no duping or glitching when removing anything... the wrecks are instantly gone on all clients, and the deconstruction process stops if another player gets to close on the veine wreck.

 

Still dont know why no one every adressed this bug, because as i said... its the most popular duping bug which can bring groups a nearly infinite amount of gold.

Link to comment
Share on other sites

  • 0

We had this issue on many servers, and i know servers that also say "we fixed the vein-duping-bug", so it seems to be a standard-epoch-issue that not only me has faced before. I also played on other servers before and had the same bug with ruins of destructed buildables.

 

Link to comment
Share on other sites

  • 0

It depends how you structured your economy, my server has very harsh settings - Most Cars and Weapons are Expensive, selling cars is maxed at 10 gold, and choppers are maxed at 20 gold... Most of the Weapons dont give you more then 3-5 Gold, also we lowered the general loottable-weapon-output. We are aiming for long-term and realistic fun, not the 2 DMRs in every Barrack, 10000 Vehicles, 4 Briefcases for everything-fun-server-stuff.

So in my case, mining the veins is one of the best jobs to earn gold... also we have a gem-trader with randomized prices each restart, so you have to check when it is the best time to sell your earned gems... each gem can give you up to 12 gold.

 

It depends, but yeah, on most servers out there there are better ways to earn gold.

Link to comment
Share on other sites

  • 0

Can you post your fixed code?  Having the same problem sporadically.  People can now sell gems at traders so more people are mining. 

 

Insert this to the client-only part of your init.sqf or put it in an external sqf-file and execute it via execVM-Call:

 

"dayzEpochRmvWreck" addPublicVariableEventHandler {
	private["_list","_iPos","_iType"];
	_iType = (_this select 1) select 1;
	_iPos = (_this select 1) select 0;
	_list = nearestObjects [_iPos, [_iType], 3];
	{deleteVehicle _x;} foreach _list;
};

I gues you already use a customized remove.sqf? Then here are my changes...

Find the line that says "sleep 0.1;", BEFORE this line you add the following:

private["_notNearestPlayer"];
_notNearestPlayer = _obj call dze_isnearest_player;
if (_notNearestPlayer) then {
	cutText ["Another player is to close - Canceled deconstruction", "PLAIN DOWN"];
	r_doLoop = false;
};

Now search for the line that says

if (_isMine) then {

and after it you insert:

dayzEpochRmvWreck = [getPos _obj,_objType];
publicVariable "dayzEpochRmvWreck";

I hope i havent forgot anything, ah... you need to adjust your publicvariable.txt of battleye... just add !="dayzEpochRmvWreck" to the first kick-line.

Link to comment
Share on other sites

  • 0
On 28.03.2014 at 3:11 PM, grafzahl said:

 

Insert this to the client-only part of your init.sqf or put it in an external sqf-file and execute it via execVM-Call:

 


"dayzEpochRmvWreck" addPublicVariableEventHandler {
	private["_list","_iPos","_iType"];
	_iType = (_this select 1) select 1;
	_iPos = (_this select 1) select 0;
	_list = nearestObjects [_iPos, [_iType], 3];
	{deleteVehicle _x;} foreach _list;
};

I gues you already use a customized remove.sqf? Then here are my changes...

 

Find the line that says "sleep 0.1;", BEFORE this line you add the following:


private["_notNearestPlayer"];
_notNearestPlayer = _obj call dze_isnearest_player;
if (_notNearestPlayer) then {
	cutText ["Another player is to close - Canceled deconstruction", "PLAIN DOWN"];
	r_doLoop = false;
};

Now search for the line that says


if (_isMine) then {

and after it you insert:


dayzEpochRmvWreck = [getPos _obj,_objType];
publicVariable "dayzEpochRmvWreck";

I hope i havent forgot anything, ah... you need to adjust your publicvariable.txt of battleye... just add !="dayzEpochRmvWreck" to the first kick-line.

Works on an epoch, but does not work on overpoch :(
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...