Jump to content
  • 0

How do i make stuff un-removable?


Draay

Question

Basically, i would like to make sandbags/fuelpumps/wirefences/tank traps not removable unless you have placed them down yourself.

Right now, players landing on bases and stealing them as long as they have an e-tool.

 

I'm using plot management and  is meant to fix an issue im having from plot management where players cant remove their items, this fixed it).

 

In the variables.sqf i have this (only part of it):

http://pastebin.com/xiDrMPBH

 

 

Any help would be great, thanks!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Here use this part from

 

REMOVING

For your players to be able to remove the custom buildables they make you will need to do the following.

Go into your custom variables again and find this line.

dayz_allowedObjects =

just below this line

WG_OwnerRemove =[];

and insert any of the class names of items you want in the custom build system.

Go back into your fn_selfActions.sqf and find

_isModular = _cursorTarget isKindOf "ModularItems";

and change it to this

_isModular = (_cursorTarget isKindOf "ModularItems") or ((typeOf _cursorTarget) in WG_OwnerRemove); you must remember to add your custom items to the "dayz_allowedObjects" and "DZE_maintainClasses" sections in your variables.sqf any object you add to "DZE_isRemovable" will be removable by anyone!

Link to comment
Share on other sites

  • 0

Here use this part from

 

REMOVING

For your players to be able to remove the custom buildables they make you will need to do the following.

Go into your custom variables again and find this line.

dayz_allowedObjects =

just below this line

WG_OwnerRemove =[];

and insert any of the class names of items you want in the custom build system.

Go back into your fn_selfActions.sqf and find

_isModular = _cursorTarget isKindOf "ModularItems";

and change it to this

_isModular = (_cursorTarget isKindOf "ModularItems") or ((typeOf _cursorTarget) in WG_OwnerRemove); you must remember to add your custom items to the "dayz_allowedObjects" and "DZE_maintainClasses" sections in your variables.sqf any object you add to "DZE_isRemovable" will be removable by anyone!

 

Thanks for your time and effort to find this for me, i will try this later tonight on my test server and i will report back with my findings.

 

Edit: The fix above didn't do the trick but i found it!

For anyone that needs it, this is what i did. I'm not a scripter. Please use at your own risk, i added this myself and it works for me.

 

 

Open your fn_selfActions.sqf

Change:

 

//Allow player to delete objects
if(_isDestructable  or _isWreck or _isRemovable or _isWreckBuilding) then {
if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_player_deleteBuild = true;
};
};
to
//Allow player to delete objects
if((_isDestructable && _ownerID == dayz_characterID) or _isWreck or _isRemovable or _isWreckBuilding) then {
if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_player_deleteBuild = true;
};
};

 

I found:

_isDestructable = _cursorTarget isKindOf "BuiltItems";

and after i found what "BuiltItems" were, it clicked in my head.

For anyone wanting to know what BuiltItems is:

http://epochmod.gamepedia.com/Category:Built_Items

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