Jump to content
Sign in to follow this  
mcnools

Lock crate for all players except one.

Recommended Posts

Hello, I'm working on a MP mission where I want an item in a crate that only one specific playable unit can access. Is there any way to do this by scripting? I tried to search but I could only find really old scripts that I couldn't get working.

Share this post


Link to post
Share on other sites

Are you planning to do that for a specific class, let's say, only for pilots?
Or maybe only for a specific SteamID whether in MP?
.
EDIT:
But as you mentioned "one specific playable unit", your idea is to do that for a specific unit name, correct?

Share this post


Link to post
Share on other sites
6 hours ago, JCataclisma said:

Are you planning to do that for a specific class, let's say, only for pilots?
Or maybe only for a specific SteamID whether in MP?
.
EDIT:
But as you mentioned "one specific playable unit", your idea is to do that for a specific unit name, correct?

 

Yes, the idea is to do it for a specific unit name, I've given all the units in our squad ID's (the one who should be able to open the crate is RadioOperator).

Share this post


Link to post
Share on other sites

Name your crate ("c1" for example)

 

initPlayerLocal.sqf:

params ["_player", "_didJIP"];

waitUntil {(!isNull (findDisplay 46))};

if (_player != RadioOperator) then 
{
	c1 lockinventory true;
};

 

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

@Harzach It seems to work fine! Thank you very much man!

  • 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
Sign in to follow this  

×