Jump to content

[Fix] Remove Veins and Crates global


Recommended Posts

What it does?

 

Removes Veins and Crates global, so its only lootable once and not for each player.

 

What you need?

 

variables.sqf

server_function.sqf

remove.sqf

 

Lets get started:

 

variables.sqf

 

replace this line:

DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck","Land_ammo_supply_wreck"];

with this:

DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Iron_Vein_DZE","Silver_Vein_DZE","Gold_Vein_DZE","Supply_Crate_DZE"];

Safe and done.

 

 

remove.sqf

 

 

Optional Step (Anti Dupe) Start

 

place this line

if(({isPlayer _x && _x != player} count (player nearEntities [['CAManBase'], 10])) > 0 && _isWreck  && _isWreckBuilding && !_isModular) exitWith { cutText ["The other Person interrupting my actions" , "PLAIN DOWN"]; };
under this line
_isModular = _obj isKindOf "ModularItems";

Optional Step (Anti Dupe) End

 

place this (may want to use switch case if you want to):

if (_objType in ["Iron_Vein_DZE","Silver_Vein_DZE","Gold_Vein_DZE","Supply_Crate_DZE"]) then {
	if (_objType == "Iron_Vein_DZE") 	then 	{_objType = "Land_iron_vein_wreck"};
	if (_objType == "Iron_Vein_DZE")	then	{_objType = "Land_iron_vein_wreck"};
	if (_objType == "Silver_Vein_DZE")	then	{_objType = "Land_silver_vein_wreck"};
	if (_objType == "Gold_Vein_DZE")	then	{_objType = "Land_gold_vein_wreck"};
	if (_objType == "Supply_Crate_DZE")	then	{_objType = "Land_ammo_supply_wreck"};
};

under this line

_isModular = _obj isKindOf "ModularItems"; 

safe and done.

 

 

server_function.sqf

 

place this lines

_veh addEventHandler ["HandleDamage", {false}];
			_veh enableSimulation false;

under 

_veh setVariable ["ObjectID","1",true];

this steps needs to be done in following sections:

spawn_mineveins = {

and 

spawn_ammosupply = {

safe and done

 

Note: I hope i did not forget anything. Test it and tell the result

As allways, dont expect noob friendly support :)

 

Liked this work? Why not support me with a small donation?

 arrow_down_animated.gifarrow_down_animated.gifarrow_down_animated.gifarrow_down_animated.gif

Link to comment
Share on other sites

Maybe it's better to remove all event Handlers, before putting that one in, as one Vehicle can have Multiple Event Handlers.

_veh RemoveAllEventHandlers ["HandleDamage"];
_veh AddEventHandler

Link to comment
Share on other sites

  • 7 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...