Jump to content
  • 0

Custom Door


monkeybrain

Question

objectDoor hideObject true;

titleText ["The door opens for 10 seconds", "PLAIN", 7];

playSound "open";
sleep 10;
titleText ["The door closes", "PLAIN"];
playSound "open";
objectDoor hideObject false;

So I'm trying to make a custom door open and shut, but my script doesn't work in multilayer. I even tried setpos of objectdoor below the ground when it opens, and back up when it closes, however nothing works. (It works in editor)

 

The script is triggered from a sign

 

Is this antihack playing up or am I failing at something?(im using infistar)

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

the problem is the "hideObject" order, its blocked by REsec.sqf  in your SERVER files, you will probably run into another problem, the door will just hide for the activating player, so you could use it as an exploit while you are in and the door is hidden you can shoot out but your opponent cant shoot in or see you.

 

to make the door hide for every player you need to execute the hide order from the server, you can place a function in your init.sqf for it like :

if (isDedicated) then {

	"rcrHideRoof" addPublicVariableEventHandler {
		
	_packet = _this select 1;
	_nearestGates = _packet select 1;
	
	{
     _x setVariable ["GateLowered", true, true];
	[nil, _x, "per", rHideObject, true] call RE;
	
	
	} foreach _nearestGates;
	
	
	
	};
	
	
	"rcrUnHideRoof" addPublicVariableEventHandler {
	
	_packet = _this select 1;
	_nearestGates = _packet select 1;
	
	{
	_x setVariable ["GateLowered", false, true];
	[nil, _x, "per", rHideObject, false] call RE;
	
	
	} foreach _nearestGates;
	
	};
	
};

and call it within your script with a line like :

rcrHideRoof = [player, _nearestGates];
publicVariable "rcrHideRoof";

now the door is hidden for everybody EXCEPT players joining after/while you have hidden the door.

 

for join in progress (jip) players, you need to have a line like this at the very bottom of your init.sqf

	//HideableRoofs
	[] execVM "rcr\jipHide.sqf";
	#include "rcr\REsec.sqf"

my jipHide.sqf looks :

waitUntil {!isNil "dayz_animalCheck"};



_nearestGates = nearestObjects [player, ["MAP_Ind_Shed_01_main"], 20000];

{


_openGates = _x getVariable ["GateLowered", false];

If (_openGates) then {

[nil, _x, "per", rHideObject, true] call RE;

};



} foreach _nearestGates;

maybe you have to mess with the BE filters and infistar too, but dont worry the major amount of work is already done ;)

Link to comment
Share on other sites

  • 0

Sorry for the late post, Ive been so busy!

 

REsec.sqf do I have to change anything with this file?

 

 

my open door should look like this?

or am i meant to incorporate _nearestgates into the line when the door is meant to be opened

rcrHideRoof = [player, _nearestGates];
publicVariable "rcrHideRoof";

if ((getPlayerUID player) in
    
    "76561198012291154" //James
   
    ]) then {

objectDoorUID hideObject true;

titleText ["The door opens for 10 seconds", "PLAIN", 7];

playSound "open";
sleep 10;
titleText ["The door closes", "PLAIN"];
playSound "open";
objectDoorUID hideObject false;

};
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
  • Advertisement
  • Discord

×
×
  • Create New...