Jump to content
  • 0

Safezones without Gear Menu "Open Backpack"


Cryten

Question

is it possible to disable the Gear menu "Open Backpack" so that other players can steal anything?

 

besr regards Cryten

 

is used this script.

Private ["_EH_Fired"];

if (isNil "inSafezone") then {
	inSafezone = false;
};

while {true} do {
	waitUntil { inSafeZone };
	titleText [format["Du betritts die SafeZone. GodMod Aktiviert!"],"PLAIN DOWN"]; titleFadeOut 4;

	waitUntil { player == vehicle player };

	thePlayer = vehicle player;
	_EH_Fired = thePlayer addEventHandler ["Fired", {
		titleText ["Deine Waffen sind deaktiviert!","PLAIN DOWN"]; titleFadeOut 4;
		NearestObject [_this select 0,_this select 4] setPos[0,0,0];
	}];

	player_zombieCheck = {};
	fnc_usec_damageHandler = {};
	fnc_usec_unconscious  = {};
	thePlayer removeAllEventHandlers "handleDamage";
	thePlayer addEventHandler ["handleDamage", {false}];
	thePlayer allowDamage false;

	waitUntil { !inSafeZone };

	titleText [format["Du verlaesst die Safezone. GodMod deaktiviert!"],"PLAIN DOWN"]; titleFadeOut 4;
	thePlayer removeEventHandler ["Fired", _EH_Fired];

	player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
	fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
	fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
	thePlayer addEventHandler ["handleDamage", {true}];
	thePlayer removeAllEventHandlers "handleDamage";
	thePlayer allowDamage true;
};
Link to comment
Share on other sites

Recommended Posts

  • 0

Its the same old thing with Arma, it can be brute forced. You should be able to set it to knock a player out if within XX distance of another player.

 

Might not be a perfect solution but a temporary "stun" would stop the brute forcing at least.

 

If someone hasnt done this for later I'll do it :)

Link to comment
Share on other sites

  • 0

Its the same old thing with Arma, it can be brute forced. You should be able to set it to knock a player out if within XX distance of another player.

 

Might not be a perfect solution but a temporary "stun" would stop the brute forcing at least.

 

If someone hasnt done this for later I'll do it :)

 

Going to test this

// This script was written by SilverShot.
_fix = false;
while { !canbuild } do
{
    sleep 0.1;

    if( !isNull (FindDisplay 106) ) then
    {
        if( !_fix ) then
        {
            player action ["GEAR", ""];
            r_player_unconscious = true;
            player setVariable["medForceUpdate",true,true];
            player setVariable ["300", r_player_timeout, true];
            titleText["\n\nCan only access your gear in the safe zone.", "PLAIN DOWN",0];
            _fix = true;            
        };
    } else {
        if( _fix ) then
        {
            _fix = false;
        };
    };
};

Edit: This works, it knocks the player to the ground

Link to comment
Share on other sites

  • 0

GJ Dave, do you not only need r_player_unconcious = true; in there, whats the other fluff stuff do? :o

 

Will edit that later to only do it when a player is within say 5m - so you can sort your own inventory without needing to leave the zone

Link to comment
Share on other sites

  • 0

I tried to add it so that it checks if a player is nearby and if they are friendly, then to reload the gear dialog but I'm struggling.

 

Anyone else fancy giving it a go as I think that would work well if it checked for players around you and then checked if they were friendly tagged, if they aren tagged then the person opening the gear gets knocked out.

Link to comment
Share on other sites

  • 0

Hi Guys im using maca134 safe zone script

 

my mission file looks like this

 

 

expActiv="inSafeZone = true;";
expDesactiv="inSafeZone = false;";

 

would this work

 

expActiv="inSafeZone = true; canbuild = false;"; execVM ""theft.sqf"";
expDesactiv="inSafeZone = false; canbuild = true";

 

?

 I tried this and get a Failed to load Mission when logging in

 

Thanks in Advanced

Thade
 

Link to comment
Share on other sites

  • 0

Hi,

 

I modified the version I made to allow the same as above, picking up ground items, but prevent access to vehicles/players. See my original message/instructions several posts up.

 

This version is based on the vehicle locked gear script by Zabn. It closes the gear menu when trying to access something that's invalid.

 

EDIT: It is still possible to access stuff you are not supposed to... urgh. I won't explain how but something needs to be done, this method is obviously not good enough.

// This script was written by SilverShot.
while { !canbuild } do
{
	waitUntil{canbuild or !isNull (FindDisplay 106)};

	if( !isNull (FindDisplay 106) ) then
	{
		if( !isNull cursorTarget ) then
		{
			_cTarget = cursorTarget;
			_blk = false;
			{
				if(!_blk) then {
					_blk = _cTarget isKindOf _x;
				};
			} forEach ["LandVehicle","Air","Man"];

			if( _blk ) then {
				titleText["\n\nCan only access your gear in the safe zone.", "PLAIN DOWN",0];
				(FindDisplay 106) closeDisplay 1;
			};
		};
	};
};
Link to comment
Share on other sites

  • 0

I have a new version which I think stops access 100% this is the best method imo. It uses the vehicle lock gear access restriction so you don't even see the gear menu. If you are tagged as friendly you can access each others backpack.

 

You must edit fn_gearMenuChecks.sqf (and where call to compile is in compiles.sqf changing the path to work for your mission file, sorry but if you don't know how to do this search).

 

Add this to the bottom of fn_gearMenuChecks.sqf.

 

Enjoy :)

 

// IN SAFE ZONE
if( !canbuild ) then
{
	if( isPlayer cursorTarget and alive cursorTarget and vehicle cursorTarget == cursorTarget ) then
	{
		_friendlies = player getVariable ["friendlyTo",[]];
		_ownerID = cursorTarget getVariable ["CharacterID", "0"];

		_friend = _ownerID in _friendlies;

		// check if friendly to owner
		if( !_friend ) then {
			cutText["\n\nBag access is restricted in safe trader zones except with those tagged as friendly.", "PLAIN DOWN",0];
			_display closeDisplay 1;
		};
	};
};
Link to comment
Share on other sites

  • 0

 

I have a new version which I think stops access 100% this is the best method imo. It uses the vehicle lock gear access restriction so you don't even see the gear menu. If you are tagged as friendly you can access each others backpack.

 

You must edit fn_gearMenuChecks.sqf (and where call to compile is in compiles.sqf changing the path to work for your mission file, sorry but if you don't know how to do this search).

 

Add this to the bottom of fn_gearMenuChecks.sqf.

 

Enjoy :)

 

// IN SAFE ZONE
if( !canbuild ) then
{
	if( isPlayer cursorTarget and alive cursorTarget and vehicle cursorTarget == cursorTarget ) then
	{
		_friendlies = player getVariable ["friendlyTo",[]];
		_ownerID = cursorTarget getVariable ["CharacterID", "0"];

		_friend = _ownerID in _friendlies;

		// check if friendly to owner
		if( !_friend ) then {
			cutText["\n\nBag access is restricted in safe trader zones except with those tagged as friendly.", "PLAIN DOWN",0];
			_display closeDisplay 1;
		};
	};
};

 

 

Isn't this only where Canbuild is active, ie not at a trader? Shouldn't there be an "else" in there?

Link to comment
Share on other sites

  • 0

MGT,

It works for me on mine

 

Bags

 

 

MGT here clear.png thanks for the credit

There's a bug

Buy an armed vehicle at the trader with protection and attempt to fire mounted weapon - weapon doesn't fire as intended and the script works.

Drive out of protected area then drive back in, the mounted gun now works and fires and the script fails.

Hope you can figure this out as it's a great script.

 

Post got removed :rolleyes:

 

 

Sort it out here, not in public

 

 

Cheers Retra,

@ Dave - I am aware of this bug, it also happens if you drive a mounted vehicle into a trader zone without getting out and back into your vehicle.

Unfortunately i have not the time to fix it just yet, perhaps in the next few days.

Cheers.

 

So no, it doesn't work and i'm posting it here as the ethos of OpenDayz was openess and this will save server owners the time in installing it to find that it's not quite working as intended.

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
×
×
  • Create New...