Jump to content
woulffman

Passcode for addaction

Recommended Posts

Is it possible to have a player type a code for an action to work?  I'd like to have a laptop that will allow a player who knows a 4 digit pin to be able to select for a list of actions.  I have the addaction stuff down but don't know how to require a pin be entered first.

Share this post


Link to post
Share on other sites

I'd make a dialog with a RscEdit or a keypad consisting of a few buttons. The dialog would be created with an addAction. When the correct pin is entered the action is replaced by your options (or another dialog is opened with the options in a list).

  • Like 1

Share this post


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

Is it possible to have a player type a code for an action to work?

 

There are likely scripts others have made that could reproduce what you're looking for. Once you've found the right one, you might be able to slip it into the script as a parameter into the AddAction.

Share this post


Link to post
Share on other sites
On 12/27/2019 at 8:20 PM, woulffman said:

Is it possible to have a player type a code for an action to work?  I'd like to have a laptop that will allow a player who knows a 4 digit pin to be able to select for a list of actions.  I have the addaction stuff down but don't know how to require a pin be entered first.

Soooo I may have spent a few hours to throw together a simple framework for adding the ability to start up PCs, password them, assign categories to them and add actions to PCs dependent on their categories... Woops.

 

It was mostly for fun but if you're interested take a look at this: 

Spoiler

Link: https://www.dropbox.com/s/wejt3k1l5wq8k1m/PPC_test.VR.zip?dl=0

 

Usage:

1 - Copy over relevant files.

2 - Add your actions in "actions.sqf"

3 - Place a laptop.

4 - Add something like this in the laptop's init:


0 = [this, "password", ["mission_critical"]] spawn PPC_fnc_init;

The first param is pretty self-explanatory.

The second is also pretty simple however if no password is provided (or it's set to "") the computer will log straight in and let you do it's actions without the login UI.

The third allows you to set which categories the PC belongs to. This way you can set up multiple PCs in the mission that have different sets of actions assigned to them.

To add or edit actions you open the "actions.sqf" inside the PPC folder.

 

So in the example above I've just put a "Hack" action under the category "mission_critical" and then added it to the PC with the above code. I also added a "Read e-mails" action that is added on all PCs using the "all" category.

Each action is just defined as an array of ["categoryname", [addAction array] ] so you should be able to do whatever you wish.

See "actions.sqf" for more details.

 

This should be MP compatible unless I've missed some locality issues.

If you got any questions just throw me quote or mention.

 

 

  • Like 6

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

×