Jump to content
Darihon

[WIP/RELEASE] Bank Robbery V3.

Recommended Posts

Current state: V3 [W.I.P]

 

Hello,

 

I've been working on this script for atleast a few days now and it's ready for it's release. It is still a work in progress and gets updated on people's feedback and/or problems. 

 

The script works very easy:

Whenever a player looks at a laptop an option shows up: "Rob Bank". Whenever they activate the script they have a 30% chance for it to go succesfully. If the bank robbery goes succesful, the script picks a random number and a random loot based on the random number. The script is only runable once per restart!

 

Installation:

 

Add to if(isServer) { in init.sqf:

execVM "rob\bank_building.sqf";

Add in the 'fn_selfactions.sqf' file (around line 100): 

// Bank Robbery

_bankrobbery = cursorTarget isKindOf "Notebook";

    if ((speed player <= 1) && _bankrobbery && (player distance cursorTarget < 5)) then {

        if (s_player_bankrob < 0) then {

            s_player_bankrob = player addAction ["Rob the bank","rob\robbank.sqf",cursorTarget, 0, false, true, "",""];

        };

    } else {

        player removeAction s_player_bankrob;

        s_player_bankrob = -1;

    };

// Bank Robbery END
Add the AI:
Just add the "ai.sqf" inside of the "robbank.sqf" folder and the AI will spawn :)
 
 
Configuration options:

Change the object which activates the script:

_bankrobbery = cursorTarget isKindOf "Notebook";
Change "Notebook" to another classname i.e "Land_Chair_EP1"
Allow the script to run multiple times:

I've add something that allows that inside of the "robbank.sqf". 
At the bottom of the script is the following located:

// sleep seconds;
// script_in_progress = false; 
Remove the // in front of those 2, so it should look like this:

sleep seconds;
script_in_progress = false; 
Change the "seconds" in your wanted time (in seconds)
Different loot:

Let's take the jackpot for example:
 

if (_random2 == 5) then {
cutText [format["Jack.. Jack.. Pot!!"], "PLAIN DOWN"];
player addMagazine _briefcase;
player addMagazine _briefcase;
systemChat "Ting ting ting... The jackpot has been stolen! Bye bye 2 briefcases";
}; 

 
It's not that hard to change the loot. All u want to do is the following:
add/edit the "player addMagazine" code, so if u want to add another briefcase, then it should like this:
player addMagazine _briefcase;

 
Download:
Version 2.9 [DROPBOX] [not working correctly]
 
 
Feedback, problems:
Everything is appreciated. Feedback can make this script better and improves the fun of it. 
 
Thanks to:
Halvhjearne
Boyd
Peipo118
Ebayn.0.0b

Share this post


Link to post
Share on other sites

Reserved for further updates.. 

 

The bank is located inside of Novy Sobor:

http://pastebin.com/5GW6ALby

Installation:

  •  
  • Make a folder in your dayz_server.pbo called "maps" or something like that.
  •  
  • Open ur server_functions.sqf (dayz_server.pbo --> init --> server_funtions.sqf) 
  •  
  • Open the file and scroll down to the bottom and add the following:
execVM "\z\addons\dayz_server\path\bank.sqf";

So it should look like this:

diag_log format["SAFE LOCKED: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player)];
};
execVM "\z\addons\dayz_server\path\bank.sqf";


Share this post


Link to post
Share on other sites

very nice :)

though, i do have an idea :P

 

how about having AI spawning during a 5 minute countdown timer that the player has to defend against, like an 'everlasting' stream of AI.

of course, everlasting is too many ai but you could have 20 maybe and every time one dies it gets replaced.

if the person who activates the robbery gets killed then the whole robbery is cancelled. then whole groups of people could work together to get some awesome loot.

just an idea :)

Share this post


Link to post
Share on other sites

if u close the game and come bk in u can rob the bank again and if u fire 1 shot with a dmr when ur standing next to the table in the bank the table starts dancing around and same with the laptop

Share this post


Link to post
Share on other sites

if u close the game and come bk in u can rob the bank again and if u fire 1 shot with a dmr when ur standing next to the table in the bank the table starts dancing around and same with the laptop

 

Aha, never tested that. Will take a look at it and the next version (1.1) will include hard AI, so I don't think u want to rob the bank multiple times since the chance is high that u die. About the DMR shot, not sure about that one, could be caused because the object are placed inside of a building, I will try changing "CAN_COLLIDE" to "NONE". I will update you within an hour.

Share this post


Link to post
Share on other sites

instead of all these if's you should rather use a switch case ...

 

Possible, my personal preference goes to the "if", but I'll take a look at it..

 

 

if u close the game and come bk in u can rob the bank again and if u fire 1 shot with a dmr when ur standing next to the table in the bank the table starts dancing around and same with the laptop

 

About the Notebook and Desk flying around. "NONE" hasn't worked either. Probally because they are an object, they have a basic physic and that allows them to fly away when u shoot at them, but that's just a thought. I'll take a further look at it later today. Thanks for reporting!

 

Just spawn some Arma infantry, you don't need any AI script to do that.

I'm working on that, you probally took a look at my pastebin profile which contains a file called "AI.sqf". That is only a WIP and I will put it inside of the "robbank.sqf" once it is ready. So, it's basicly a testing script so I don't have to do the whole process of robbing the bank. 

Share this post


Link to post
Share on other sites
if(script_in_progress)exitwith{
        systemChat "This script is only useable once (untill restart)!";
};

It exits the loop only, not the script.

 

 

 if (_random2 == 0) then     if (_random2 == 3) then     if (_random2 == 6) then 

 if (_random2 == 1) then     if (_random2 == 4) then 

 if (_random2 == 2) then     if (_random2 == 5) then 

Better use: swith {_random2 } do {};

                         

         

// Checks if script is active, thanks Halvhjearne <3
if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
        systemChat "This script is only useable once (untill restart)!";
};
script_in_progress = true;
// End Checks if Script is active

Are you sure what it working ?

You attach importance to, and then immediately check it out. What's the point?

"script_in_progress" - what is it ? Where are you find it ?

 

 

 

if (_random2 == 5) then {

Chance to _random be equal "5":

You think: 1/6 

Real:           0.16666666666666669 %

 

Share this post


Link to post
Share on other sites

Wow.. That's a lot of useful tips and critic. About the "switch" way, if u've read the topic, then u'd have seen this:

"Possible, my personal preference goes to the "if", but I'll take a look at it.."

About the "loop", I'm working on that, trying to find a better way, no luck so far.. 

About the random part, I am no math man. If I'm honest, I hate math + 1/6 seems to be the same as 0,16? 

 

Thanks for the useful tips, lmapper. I'll take a look at them.

 

Video will come up later tonight or tomorrow <3.

 

EDIT:

Thanks for the tip, Csus. I'll take a look at it.

Share this post


Link to post
Share on other sites
About the random part, I am no math man. If I'm honest, I hate math + 1/6  0,16? 

 

 

 1/6    =     1/6

0.16   =   1/625 

 

 

just change 

floor(random 6)

to

floor(random 6.99)

Share this post


Link to post
Share on other sites

Alright, thanks Lmapper. Will change in the next patch.

 

Karamell, really strange. I haven't had time yet to test it, but when I shot it with a stanag gun, it started dancing once and then stayed static (laptop), the desk was moveable when u shoot at it. 

Share this post


Link to post
Share on other sites

thank you very much ... ;)

I just added this script and I can confirm the laptop and desk fidgeting after gunfire. My attempt to rob da bank failed, but I am interested to see where this goes. Nice addition Darihon. Keep at it, much appreciated.

Thanks for the positive feedback, I haven't had time yet to take a look at a fix for the dancing table and laptop :).

 

v1.1 will be out soon, which contains AI (spawns whenever the bank robbery has started succesfully) and they are hard (+ dancing table fix)

Share this post


Link to post
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
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×