Jump to content
  • 0

Backpacks despawn


MGT

Question

22 answers to this question

Recommended Posts

  • 0

So, 

private ["_weapons","_magazines","_weaponscnt","_magazinescnt","_backpack"];
_backpack = nearestObject [player, "Bag_Base_EP1"];
if (!(isNull _backpack) and local _backpack) then {
        _weapons =                 getWeaponCargo _backpack;
        _magazines =         getMagazineCargo _backpack;
        _weaponscnt = count (_weapons select 0);
        _magazinescnt = count (_magazines select 0);
        if((_magazinescnt > 0) or (_weaponscnt > 0)) then {
                /* PVS/PVC - Skaronator */
                _pos = getPosATL player;
                _inRange = _pos nearEntities ["CAManBase",300];
                {
                        // run only on other players 
                        if(isPlayer _x and _x != player) then {
                                PVDZE_send = [_x,"HideObj",[_backpack]];
                                publicVariableServer "PVDZE_send";
                        };
                } forEach _inRange;
        };
};

and

 

player_dumpBackpack = compile preprocessFileLineNumbers "Fixes\player_dumpBackpack.sqf";

is confirmed to work?

Link to comment
Share on other sites

  • 0

You need to compile the file on your server, otherwise it won't work.

 

Open compiles.sqf on your server and add this line:

player_dumpBackpack = compile preprocessFileLineNumbers "Fixes\player_dumpBackpack.sqf";

and then make or copy the file player_dumpBackpack.sqf to the Fixes folder and add the code I posted above in it.

 

That should fix it.

Link to comment
Share on other sites

  • 0

Working fine for us

 

You need to pull player_dumpBackpack.sqf to your mission file from dayz_code and link it in a custom compiles.sqf (search forum for that)

Edit player_dumpBackpack.sqf with the following

private ["_weapons","_magazines","_weaponscnt","_magazinescnt","_backpack"];
_backpack = nearestObject [player, "Bag_Base_EP1"];
if (!(isNull _backpack) and local _backpack) then {
	_weapons = 		getWeaponCargo _backpack;
	_magazines = 	getMagazineCargo _backpack;
	_weaponscnt = count (_weapons select 0);
	_magazinescnt = count (_magazines select 0);
	if((_magazinescnt > 0) or (_weaponscnt > 0)) then {
		/* PVS/PVC - Skaronator */
		_pos = getPosATL player;
		_inRange = _pos nearEntities ["CAManBase",300];
		{
		// run only on other players 
		if(isPlayer _x and _x != player) then {
		PVDZE_send = [_x,"HideObj",[_backpack]];
		publicVariableServer "PVDZE_send";
     };
		} forEach _inRange;
	};
};
Link to comment
Share on other sites

  • 0

Dont think you understood me.

 

I've edited the file "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";"

 

I didnt pull it into my mission.

I've unPBO the dayz_code, edited the file player_dumpBackpack.sqf according to instructions. PBOed it back and reuploaded in the server.

 

I am using a custom compiles.sqf file in my mission file. and it already contains the line:

player_dumpBackpack =  compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";

And my init.sqf is calling the custom compiles.sqf:

call compile preprocessFileLineNumbers "scripts\compiles.sqf";

So i do not see why it doesnt work?

 

I basically did what you guys did, but without pulling the file to my mission file. And using a custom compiles.

Link to comment
Share on other sites

  • 0

You must put it in the MISSION file as you are editing the client files, server side that the client does not ever have access to. The mission file version will overwrite the client sides version.

 

Alright. really strange tho, cause other stuff that i made changes to in dayz_code, worked normally, i didnt have to call them from inside the mission file. But oh well, it worked, thats what matters, heh. Thanks!

Link to comment
Share on other sites

  • 0

So Backpacks are being "hidden" to other players if you drop it within 300m of another player?

alot of players on my server are asking why they cant see the backpack that the friend dropped and sometimes if an "empty" backpack is dropped they see the Text but still cant do anything with it.

Link to comment
Share on other sites

  • 0

do i have to REMOVE the player_dumpBackpack.sqf from dayz_code compile? or just add a copy to missions?

 

Just copy it to missions and edit and pull from a custom compiles. You can remove it from dayz_code otherwise players wont be able to connect to your server.

Link to comment
Share on other sites

  • 0

Just copy it to missions and edit and pull from a custom compiles. You can remove it from dayz_code otherwise players wont be able to connect to your server.

i guess you mean i cant remove it.

Thanks alot!

Link to comment
Share on other sites

  • 0

would it not work by putting it into your mission folder and running it with this code?

 

[] ExexVM "player_DumpBackpack.sqf"; in the init?

 

im running on vilayer so our hosting might have a different way of structuring the files

 

we dont run a custom compiles folder

 

nvm just tested it, doesnt work

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