Jump to content

Recommended Posts

Hi, does not this command work in a dedicated server on players?

initPlayerLocal.sqf

backpackContainer player lockInventory true;

I'm checking if the inventory is locked with lockedInventory backpackContainer player and it says it's true but it still accessible from a third party.

Share this post


Link to post
Share on other sites

Looking at the top pf this biki page

 

https://community.bistudio.com/wiki/lockInventory

 

shows you LE which means Local Effect.

This means it locks the backpack for the client where it was executed only.

 

You have to remotely execute it on all clients.

 

https://community.bistudio.com/wiki/remoteExec

 

Edit:

This should work but I cant test it:

 

[ backpackContainer player, true ] remoteExec [ "lockInventory", -2, true];

  • Like 1

Share this post


Link to post
Share on other sites

Thanks @sarogahtyp

 

I have to execute the command again when a player respawn else the backpackContainer is not locked.

InitPlayerLocal.sqf

[backpackContainer player, true] remoteExec ["lockInventory", -2, true];

 

onPlayerRespawn.sqf

[backpackContainer player, true] remoteExec ["lockInventory", -2, true];

 

I have a question about JIP queue. The above code won't fill up the jip queue but in other context it would. How to prevent stacking in jip queue?

 

-2, true makes a new unique jip id everytime it's executing the command filling up the queue.

 

Maybe this would work?

[backpackContainer player, true] remoteExec ["lockInventory", -2, name player]; should make the player name the unique jip id, correct?

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Robustcolor said:

Maybe this would work?

[backpackContainer player, true] remoteExec ["lockInventory", -2, name player]; should make the player name the unique jip id, correct?

Looks like a smart solution for me.

 

Edit:

If you have a server with hundreds of different players then you can think about adding an event handler on server which deletes the jip entry if the player disconnects and also removes the event handler for this specific player.

But i cant fiddle that out on mobile

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, sarogahtyp said:

If you have a server with hundreds of different players then you can think about adding an event handler on server which deletes the jip entry if the player disconnects and also removes the event handler for this specific player.

But i cant fiddle that out on mobile

Hm, how do i check if a player has something in jip queue then delete it upon disconnection?

addMissionEventHandler ["HandleDisconnect",{
		remoteExec ["", "name _this select 0"];
}];

 

  • Like 1

Share this post


Link to post
Share on other sites
20 minutes ago, Robustcolor said:

 


addMissionEventHandler ["HandleDisconnect",{
		remoteExec ["", "name _this select 0"];
}];

 

looks good for me. Should work. No need to detect if there is something in the queue.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×