Jump to content

[Release] 3.0 Door Management - No More Codes


Zupa

Recommended Posts

in initDoorManagement.sqf

 

replace wwith this:

disableSerialization
if(count(_this) > 0)then{
TheDoor = _this select 0;
}else{
TheDoor = dayz_selectedDoor;
};
_display = findDisplay 41144;
_display closeDisplay 3000;
_canOpen = false;
_friends = TheDoor getVariable ["doorfriends",[]];
{
if ((_x  select 0) == (getPlayerUID player)) then{ _canOpen = true; }; 
} forEach _friends;

if ((TheDoor getVariable ["OwnerPUID","-2"]) == (getPlayerUID player)) then{ _canOpen = true; }; 

if(isNil "AdminList")then{AdminList = ["-2"];};
if ((getPlayerUID player) in AdminList) then{ _canOpen = true; }; 

if(_canOpen)then{
createDialog "DoorManagement";
call DoorNearbyHumans;
call DoorGetFriends;
}else{
cutText ["You do not have the rights to manage.","PLAIN DOWN"];
};

Can you test that for me

Zupa pointed out the missing ;

Insert a ; after disableSerialization

 

disableSerialization;

Link to comment
Share on other sites

The multi character support should be called within the description.

ext

 

Need to see your description to see how you have managed the calls :)

Description.ext
 
respawn = "BASE";
respawndelay = 5;
onLoadMission= "DayZ Epoch Chernarus";
OnLoadIntro = "Welcome to DayZ Epoch Chernarus";
OnLoadIntroTime = False;
OnLoadMissionTime = False;
disabledAI = true;
disableChannels[]={0,2};
enableItemsDropping = 0;
#include "R3F_ARTY_AND_LOG\desc_include.h"
 
briefing = 0;
debriefing = 0;
 
onPauseScript = "";
loadScreen = "\z\addons\dayz_code\gui\dayz_logo_ca.paa";
 
class Header
{
 gameType = COOP;            //DM, Team, Coop, ...
 minPlayers = 1;             //min # of players the mission supports
 maxPlayers = 100;            //Max # of players the mission supports
};
 
aiKills = 1;
diagRadio = 1;
diagHit = 1;
 
class RscText
{
type = 0;
idc = -1;
x = 0;
y = 0;
h = 0.037;
w = 0.3;
style = 0x100; 
font = Zeppelin32;
SizeEx = 0.03921;
colorText[] = {1,1,1,1};
colorBackground[] = {0, 0, 0, 0};
linespacing = 1;
};
class RscPicture
{
access=0;
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="TahomaB";
sizeEx=0;
lineSpacing=0;
text="";
};
class RscLoadingText : RscText
{
style = 2;
x = 0.323532;
y = 0.666672;
w = 0.352944;
h = 0.039216;
sizeEx = 0.03921;
colorText[] = {0.543,0.5742,0.4102,1.0};
};
class RscProgress
{
x = 0.344;
y = 0.619;
w = 0.313726;
h = 0.0261438;
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
colorFrame[] = {0,0,0,0};
colorBar[] = {1,1,1,1};
};
class RscProgressNotFreeze
{
idc = -1;
type = 45;
style = 0;
x = 0.022059;
y = 0.911772;
w = 0.029412;
h = 0.039216;
texture = "#(argb,8,8,3)color(0,0,0,0)";
};
class RscTitles
{
#include "RC\desc_inc.h"
};
 
// the loading screen itself
 
class DayZ_loadingScreen
idd = -1;
duration = 10e10;
fadein = 0;
fadeout = 0;
name = "loading screen";
class controlsBackground
{
class blackBG : RscText
{
x = safezoneX;
y = safezoneY;
w = safezoneW;
h = safezoneH;
text = "";
colorText[] = {0,0,0,0};
colorBackground[] = {0,0,0,1};
};
/*
class nicePic : RscPicture
{
style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO
x = safezoneX + safezoneW/2 - 0.25;
y = safezoneY + safezoneH/2 - 0.2;
w = 0.5;
h = 0.4;
text = "img\nicePic.paa";
};
*/
};
class controls
{
class Title1 : RscLoadingText
{
text = "$STR_LOADING"; // "Loading" text in the middle of the screen
};
class CA_Progress : RscProgress // progress bar, has to have idc 104
{
idc = 104;
type = 8; // CT_PROGRESS
style = 0; // ST_SINGLE
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
};
class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse
{
idc = 103;
};
class Name2: RscText // the text on the top-left
{
idc = 101;
x = 0.05;
y = 0.029412;
w = 0.9;
h = 0.04902;
text = "";
sizeEx = 0.05;
colorText[] = {0.543,0.5742,0.4102,1.0};
};
};
};
 
#include "admintools\dialog.hpp"
#include "custom\snap_pro\snappoints.hpp"
#include "RscDisplayCharacterSelect.hpp"
#include "spawn\defines.hpp"
#include "spawn\class.hpp"
#include "spawn\halo.hpp"
#include "spawn\spawn.hpp"
//#include "defines.hpp"
#include "doorManagement\doorUnlock.hpp"
#include "doorManagement\doorManagement.hpp"
Link to comment
Share on other sites

If you are not using Plot4Life, replace your InitDoorManagement.sqf with the following;

 

 

disableSerialization;
if(count(_this) > 0)then{
TheDoor = _this select 3;
}else{
TheDoor = dayz_selectedDoor;
};
_display = findDisplay 41144;
_display closeDisplay 3000;
_friends = TheDoor getVariable ["doorfriends",[]];
 
_adminList = ["1111111111111"]; // Add admins here if you admins to able to manage all plotpoles
_owner = TheDoor getVariable ["CharacterID","0"];
_fuid = [];
{
_friendUID = _x select 0;
_fuid = _fuid + [_friendUID];
} forEach _friends;
_allowed = [_owner];    
_allowed = [_owner] + _adminList + _fuid;
 
if((getPlayerUID player) in _allowed)then{
createDialog "DoorManagement";
call DoorNearbyHumans;
call DoorGetFriends;
}else{
cutText ["You do not have the rights to manage.","PLAIN DOWN"];
};
 
This allows the doors to be managed, _allowed code take from PlotManagement. Can probably be tidied.
 
Have Fun :)
Link to comment
Share on other sites

Hi All,

 

I've been playing with this for the last few hours. My coding knowledge isn't so good, but i've got this to work now without Plot4Life. To get this working do the following :)

 

In Player_Upgrade find "if (_lockable == 3) then {" and change it to look like the below;

 

if (_lockable == 3) then {
_combination = dayz_characterID;
_objectCharacterID = _combination;
//cutText [format[(localize "str_epoch_player_158"),_combination,_text], "PLAIN DOWN", 5];
 
Once you have done that change your InitDoorManagement.sqf to look like the following;
 
disableSerialization;
if(count(_this) > 0)then{
TheDoor = _this select 3;
}else{
TheDoor = dayz_selectedDoor;
};
_display = findDisplay 41144;
_display closeDisplay 3000;
_cursorTarget = cursorTarget;
_friends = TheDoor getVariable ["doorfriends",[]];
_owner = _cursorTarget getVariable ["CharacterID","0"];
 
_adminList = [""]; // Add admins here if you admins to able to manage all plotpoles
_allowed = _adminList + _friends;
 
if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{  
createDialog "DoorManagement";
call DoorNearbyHumans;
call DoorGetFriends;
}else{
cutText ["You do not have the rights to manage.","PLAIN DOWN"];
};
 
This is working for me know without any errors :) just make sure to add yourself to the door before you die.
 
Good luck.

 

Link to comment
Share on other sites

 

Hi All,

 

I've been playing with this for the last few hours. My coding knowledge isn't so good, but i've got this to work now without Plot4Life. To get this working do the following :)

 

In Player_Upgrade find "if (_lockable == 3) then {" and change it to look like the below;

 

if (_lockable == 3) then {
_combination = dayz_characterID;
_objectCharacterID = _combination;
//cutText [format[(localize "str_epoch_player_158"),_combination,_text], "PLAIN DOWN", 5];
 
Once you have done that change your InitDoorManagement.sqf to look like the following;
 
disableSerialization;
if(count(_this) > 0)then{
TheDoor = _this select 3;
}else{
TheDoor = dayz_selectedDoor;
};
_display = findDisplay 41144;
_display closeDisplay 3000;
_cursorTarget = cursorTarget;
_friends = TheDoor getVariable ["doorfriends",[]];
_owner = _cursorTarget getVariable ["CharacterID","0"];
 
_adminList = [""]; // Add admins here if you admins to able to manage all plotpoles
_allowed = _adminList + _friends;
 
if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{  
createDialog "DoorManagement";
call DoorNearbyHumans;
call DoorGetFriends;
}else{
cutText ["You do not have the rights to manage.","PLAIN DOWN"];
};
 
This is working for me know without any errors :) just make sure to add yourself to the door before you die.
 
Good luck.

 

 

Thats the main idea yes. (I recommend code blocks if you post code ^^)

 

You can edit your buildingUpgrade.sqf to were it upgrades a door that it  automaticly adds the builder to the list.

Link to comment
Share on other sites

To add the owner as default to the doors on placement, edit your Player_Upgrade.sqf

 

Locate this:

player reveal _object;

Paste the following code underneath:

_friendUID = getPlayerUID player;
_friendName = name  player;
_friends = [[_friendUID,_friendName]] ; 


_object setVariable ["doorfriends", _friends, true];
PVDZE_veh_Update = [_object,"gear"];
publicVariableServer "PVDZE_veh_Update";
PVDZE_veh_Update call server_updateObject;

This can be cleaned and i'm looking forward to your complete version Zupa :)

Link to comment
Share on other sites

Well, not neccesairaly.

 

If you have P4L the owner can alays access it doors and dont have to put himself on it.

 

IF NOT:

 

Write some extra code that the door placer gets auto added to the door when he builds it.

 

How it works:

 

It checks if the PlayerUID is the same as the P4L Owner Id.

If not ( or not p4l) it checks of the PlayerUID is in the doorfriendList.

Link to comment
Share on other sites

Hi,

I have this Error:

ErrorMessage: File mpmissions\DayZ_Epoch_25.sauerland\doorManagement\doorUnlock.hpp, line 25: /ComboLockUI/Controls.ZupaHeader_2: Undefined base class 'RscTextT'
Just put all Files and replace all Codeblocks like the instructions say...

I have PlotPoleManagment installt too, maybe there some conflicts?

Deleted the Defines from PlotPole Management and use the one from the Download in the first Post here... put it in the doorManagement - folder an called it in the description.ext like this

#include "doorManagement\doorUnlock.hpp"
#include "doorManagement\doorManagement.hpp"
#include "doorManagement\defines.hpp"
#include "plotManagement\plotManagement.hpp"
trying to put it in mission-rootfolder and change the path in the description doesnt change the error, also using the defines from PlotPoleManagement without the defines from this Thread change the problem....

Somebody any idea?

sry 4 my bad english..

EDIT:

I dont use P4L

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...