[RP] Bank Robbing System! [SLEDMORE]

Status
Not open for further replies.

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Hey guys,

So i have not coded in abit, and wanted to see if i'm still quite good, I saw an hotel named lollero and they pissed me off so i decided to code a bank robbing command like theirs... :').

Right, i've not tested this at all it should work. :') - If it does not, then please do give me the errors!

What does this do?
Well, it allows you to rob the banks vault, and achieve 200 credits. (That is editable) And then it automatically sends an alert to the police!

Right, heres a quick tutorial to set it up!

1) Open up your virtualusers.cs and do ctrl + f and put in "private Thread workoutDosLooper;" (No quote marks).

2) Underneath that add this "private Thread bankRobLooper;" (No quote marks).

3) Do ctrl + f and put in this "private void jailBreak()" (No quote marks).

4) Underneath that add this;

PHP:
private void bankRob()
        {
            int iCount = 0;
            try
            {
                while (true)
                {
                    using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                    {
                        if (_roomID != BANK VAULT ID HERE || roomUser.Y != BANK VAULT Y CORD HERE || roomUser.X != BANK VAULT X CORD HERE)
                        {
                            userManager.sendToCop(1, false, "BK" + "The bank is being robbed get there fast!");
                            Room.sendSaying(roomUser, "*stops robbing the banks vault*");
                            jailBreakLooper = null;
                            jailBreakLooper.Abort();
                        }
                        if (iCount == 60)
                        {
                            Room.sendSaying(roomUser, "*needs three more minutes to succesfully rob the banks vault*");
                        }

                        if (iCount == 120)
                        {
                            Room.sendSaying(roomUser, "*needs two more minutes to succesfully rob the banks vault*");
                        }

                        if (iCount == 180)
                        {
                            Room.sendSaying(roomUser, "*needs one more minute to succesfully rob the banks vault*");
                        }

                        iCount++;

                        if (iCount > 180)
                        {
                            Room.sendSaying(roomUser, "*successfully breaks into to the banks vault and claims 200 credits!*");
                            dbClient.runQuery("UPDATE users SET credits = credits + 200 WHERE id = '" + userID + "' LIMIT 1");
                            refreshValueables(true, true);
                            bankRobLooper = null;
                            bankRobLooper.Abort();
                        }
                        Thread.Sleep(1000);
                    }
                }
            }
            catch
            {
                Thread.CurrentThread.Abort();
                bankRobLooper = null;
            }
        }

Right, next step, in that code you can edit this line;
"if (_roomID != BANK VAULT ID HERE || roomUser.Y != BANK VAULT Y CORD HERE || roomUser.X != BANK VAULT X CORD HERE)"

Its obvious what you do, you put in the bank vault room id where it says "BANK VAULT ID HERE" and then you do the same for the "ANK VAULT Y CORD HERE" and the "BANK VAULT X CORD HERE".

WAIT!?! HOW DO I KNOW WHERE TO PUT THIS? HOW DO I FIND THE CORDS?

Simples, go above the tile you want it to go on and input this command :cords (on the client obviously)

If you do not have the ':cords' command then here you are;

PHP:
#region :cords
                    case "cords": // Returns the cords of the user
                        {
                            if (rankManager.containsRight(_Rank, "fuse_administrator_access", userID) == false)
                                return false;
                            else
                                sendData("BK" + "X: " + roomUser.X + "\rY: " + roomUser.Y + "\rH: " + roomUser.H);
                            break;
                        }
                    #endregion

-EDIT-

The :bankrob command!
PHP:
#region :bankrob
                    case "bankrob":
                        {
                            if (bankRobLooper == null && _roomID == YOUR BANK VAULT ID HERE && roomUser.Y == THE Y CORD OF THE TILE && roomUser.X == THE X CORD OF THE TILE)
                            {
                                userManager.sendToCop(1, false, "BK" + "The bank is being robbed get there fast!");
                                Room.sendSaying(roomUser, "*Starts to rob the banks vault*");
                                Room.sendSaying(roomUser, "*needs four more minutes to succesfully rob the banks vault*");

                                ThreadStart bankRobStarter = new ThreadStart(bankRob);
                                bankRobLooper = new Thread(bankRobStarter);
                                bankRobLooper.Priority = ThreadPriority.Lowest;
                                bankRobLooper.Start();
                            }
                            break;
                        }
                    #endregion

Add this with the other commands, remember edit the roomid, X cord and Y cord!

Then you can debug :') - Also you can edit the ammount the users get at anytime. :')

- Cheers hope you like this, (Also don't just put Sweet release! Post what i should attempt the code next thanks!).

Credits to fetariina for reminding me to add the credits refresh variable lol

;'D!

Remember to thank me if you like it ;')
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Thanks mate, Glad ya like it!
 

wallis

Member
Oct 7, 2010
115
0
I like the look of this toooooo :) Though.. when i tried it the other day, my emulator didn't find "private void jailBreak()''
 

Benden

maging ang maganda mamatay
Jun 4, 2010
2,281
1,480
Nice release but this is cheap.. What if there arent cops online and the money should come out of the corp balance can you code this in?
 

Dayron1234

Rapnameiszero,cuzIhavezero,toleranceforidiots
Jun 30, 2010
772
35
Without "private void jailBreak" the whole Jailbreak system won't work xD
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Nice release but this is cheap.. What if there arent cops online and the money should come out of the corp balance can you code this in?

Well, I'l be honest with you the money used to come out, This was in my first edition, In non tdbp, it's simple to do, set your self a task and do it ;).
 

StainedBedSheets

Trollin' since '96
Dec 22, 2010
40
2
meh, i got bored, and i changed aload of random stuff, all credit goes to Craig still ^^

PHP Code:
private void robbanker()
{
int iCount = 0;
try
{
while (true)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
if (_roomID != BANNK ID HERE || roomUser.Y != BANK Y CORD HERE || roomUser.X != BANK X CORD HERE)
{
userManager.sendToCop(1, false, "BK" + "Oh No! The Bank is being robbed! Get there quickly!");
Room.sendSaying(roomUser, "*pont's down there gun as they stop robbing the banker*");
jailBreakLooper = null;
jailBreakLooper.Abort();
}
if (iCount == 70)
{
Room.sendSaying(roomUser, "*need's 210 more second's till the bank manager fills the bag!*");
}

if (iCount == 140)
{
Room.sendSaying(roomUser, "*need's 140 more seconds till the bank manager fills the bag!*");
}

if (iCount == 210)
{
Room.sendSaying(roomUser, "*need's 70 more seconds till the bank manager fills the bag!*");
}

iCount++;

if (iCount > 210)
{
Room.sendSaying(roomUser, "*The banker fills up the bag, claiming 700 credits.*");
dbClient.runQuery("UPDATE users SET credits = credits + 700 WHERE id = '" + userID + "' LIMIT 1");
refreshValueables(true, true);
robbankerbLooper = null;
robbankerLooper.Abort();
}
Thread.Sleep(1000);
}
}
}
catch
{
Thread.CurrentThread.Abort();
robbankerLooper = null;
}
}

PHP Code:
#region :cords
case "cords": // Returns the cords of the user
{
if (rankManager.containsRight(_Rank, "fuse_administrator_access", userID) == false)
return false;
else
sendData("BK" + "X: " + roomUser.X + "\rY: " + roomUser.Y + "\rH: " + roomUser.H);
break;
}
#endregion


the robbanker command

PHP Code:
#region :robbanker
case "robbanker":
{
if (robbankerLooper == null && _roomID == YOUR BANK VAULT ID HERE && roomUser.Y == THE Y CORD OF THE TILE && roomUser.X == THE X CORD OF THE TILE)
{
userManager.sendToCop(1, false, "BK" + "The bank is being robbed get there fast!");
Room.sendSaying(roomUser, "*Pull's out their gun, as they point it too the bankers face*");
Room.sendSaying(roomUser, "*The banker starts filling the bag up with money*");

ThreadStart robbankerStarter = new ThreadStart(robbanker);
robbankerLooper = new Thread(robbankerStarter);
robbankerLooper.Priority = ThreadPriority.Lowest;
robbankerLooper.Start();
}
break;

and thanks craig for realising this <333
 

Mastah

the funny thing is \r\n i did
Oct 25, 2010
739
41
Well, I'l be honest with you the money used to come out, This was in my first edition, In non tdbp, it's simple to do, set your self a task and do it ;).

OMG I dont like the reaction of smartguy its good coded and its the best command ever
 

Kieren

The OGz
Aug 4, 2010
2,957
751
Tbh Craig I don't know why you're hotel is not getting talked about than HabboRP, I can see you, Swimo and Xavi working together and making a great hotel it would be miles better than HabboRP just saying, I mean why is Aaron getting £30 weekly for a shitty hotel when you're producing all this work? I would go for it xD
 

Mastah

the funny thing is \r\n i did
Oct 25, 2010
739
41
i thought aaron whas sued for using things of Habbo.com?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Thanks for the comments guys! ;D.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Thank you, Glad you like them ;).
 
Status
Not open for further replies.

Users who are viewing this thread

Top