Jump to content

[Howto/Release] Tie PlayerUID To All Buildable Objects / Keep plot pole after death [No SQL Triggers] UPDATE 16/04/2014


Recommended Posts

Either you did some thing wrong when you edited player_build.sqf as the characterID field in the SQL should contain your PlayerUID and should not change at all. Or you have the SQL trigger to update on death, then remove it. This is a rewrite of the epoch system and is not depended of SQL trigger, actually you will fuck it up if you have the SQL trigger

Link to comment
Share on other sites

Trick to what? This solution works on both normal vanilla epoch and otternas and my version of build system

As I say in the guide it's for vanilla but with simple logic you can apply it to both otternas and my build version, I even say at the point in the guide where you need to be aware if you use one of the snap build systems.

Link to comment
Share on other sites

I tried at least 5 hours to get this working onto my testserver until I realised, that there are no xxxxxxxxxxAX UID´s. There are just xxxxxxxxxx UID´s. I think the same problem will be at the main server? I can build up anything I want to but my Plotpole doens´t recognize any buildables and I´m not able to remove anything.

 

I use your Custom right click with admin build and snap build and changed the player_build (the only where something is not like the installation) right I think.

 

Edit:

 

Forget about that. Just have seen your post in the help request thread about the UID´s. Have to figure out what I´m missing tomorrow. Think it´s too late to work through the code :)

Link to comment
Share on other sites

I´ve double and tripple checked everything now... It seem´s like I can do everything exept of removing. The buildables are stored with the UID into the Database and I can upgrade all I want. Could there be a mess up with following code snipped out of the fn_selfActions.sqf ?

// CURSOR TARGET ALIVE
	if(_isAlive) then {
		
		//Allow player to delete objects
		if(_isDestructable or _isWreck or _isRemovable or _isWreckBuilding) then {
			if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
				_player_deleteBuild = true;
			};
		};
		
		//Allow owners to delete modulars
                if(_isModular and (dayz_characterID == _ownerID)) then {
                        if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
                                _player_deleteBuild = true;
                        };
                };
		
		// CURSOR TARGET VEHICLE
		if(_isVehicle) then {
			
			//flip vehicle small vehicles by your self and all other vehicles with help nearby
			if (!(canmove _cursorTarget) and (player distance _cursorTarget >= 2) and (count (crew _cursorTarget))== 0 and ((vectorUp _cursorTarget) select 2) < 0.5) then {
				_playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
				if(_isVehicletype or (_playersNear >= 2)) then {
					_player_flipveh = true;	
				};
			};


			if(!_isMan and _ownerID != "0" and !(_cursorTarget isKindOf "Bicycle")) then {
				_player_lockUnlock_crtl = true;
			};

		};
	
	};
Link to comment
Share on other sites

good catch forgot to add that to the tut, even in the one on my website. thx mate updating the tut now. it's a bit hard to remember all steps when doing it without notes and then when writing the tut have to retrace all the steps i did. :) Stupid me i know ;)

 

Glad I could help ;)

 

And now I know that I understand the coding a bit :D

Link to comment
Share on other sites

Sorry for OT, but I try to figure out why I don´t get the option to remove things I´ve built...

 

Where do I find a "list" of "ModularItems"? It seems like there is my problem and I just want to check everything... Another thing I could imagine, is there an option to deactivate the removing of builditems global?

Link to comment
Share on other sites

Can you remove wrecks? Because i cant anymore.. Maybe i fu*ked up something..

 

 

nvm i hade removed the whole

if(_player_deleteBuild) then {
		if (s_player_deleteBuild < 0) then {
			s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "custom\remove.sqf",_cursorTarget, 1, true, true, "", ""];
		};
	} else {
		player removeAction s_player_deleteBuild;
		s_player_deleteBuild = -1;
	};

haha

Edited by MrAlfred
Link to comment
Share on other sites

Sorry for OT, but I try to figure out why I don´t get the option to remove things I´ve built...

 

Where do I find a "list" of "ModularItems"? It seems like there is my problem and I just want to check everything... Another thing I could imagine, is there an option to deactivate the removing of builditems global?

 

variables.sqf search "DZE_isRemovable"

Link to comment
Share on other sites

variables.sqf search "DZE_isRemovable"

 

Not much in there:

DZE_isRemovable = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","Plastic_Pole_EP1_DZ","FireBarrel_DZ","Scaffolding_DZ"];

But I havn´t changed anything in there... would it be ok, If I place all of the dayz_allowedObjects in it or would that cause any trouble?

Link to comment
Share on other sites

One last thing... in fn_sefSctions.sqf I find:

_isModular = _cursorTarget isKindOf "ModularItems";
_isRemovable = _typeOfCursorTarget in DZE_isRemovable;

.
..
...

//Allow player to delete objects
		if(_isDestructable or _isWreck or _isRemovable or _isWreckBuilding) then {
			if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
				_player_deleteBuild = true;
			};
		};
		
		//Allow owners to delete modulars
                if(_isModular and (_playerUID == _ownerID)) then {
                        if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
                                _player_deleteBuild = true;
                        };
                };

For me this sounds like these are different Array´s of items. "Modular" and "IsRemovable". Could it be that I smashed up my "modular" Items? They have to be declared somewhere but I can´t find them. I know which one are Modular, but because of some events or missing files my system doesn´t know what is a modular item, so I can´t remove it.

 

I found it... havn´t had declared _playerUID. I gave you the hint that there is missing something and havn´t made it myself :D

Link to comment
Share on other sites

To be able to remove custom items as an owner this is how you would go about it:

 

In your variables.sqf i would recommend near dayz_allowedObjects create a new public array containing the objects you would be able to remove i call mine 

WG_OwnerRemove =[];

insert any classname you want from the custom build system.

 

in the custom fn_selfAction.sqf find

_isModular = _cursorTarget isKindOf "ModularItems";

and change it to 

_isModular = ((_cursorTarget isKindOf "ModularItems") or ((typeOf _cursorTarget) in WG_OwnerRemove));

now as we have a custom remove also change this

_isModular = _obj isKindOf "ModularItems";

to this

_isModular = ((_obj isKindOf "ModularItems") or ((typeOf _cursorTarget) in WG_OwnerRemove));
 
Now please lets get back to OT if you have any more custom build related questions post them there
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
×
×
  • Create New...