[RP] Bank Robbing System! [SLEDMORE]
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 Code:
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 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
-EDIT-
The :bankrob command!
PHP Code:
#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 ;')
Re: [RP] Bank Robbing System! [SLEDMORE]
This is really nice mate ;)
Good work!
Re: [RP] Bank Robbing System! [SLEDMORE]
Cheers glad ya like it ;'D!
Re: [RP] Bank Robbing System! [SLEDMORE]
Dude. This is fucking epic! Keep it up! :):
Re: [RP] Bank Robbing System! [SLEDMORE]
Quote:
Originally Posted by
What?
Dude. This is fucking epic! Keep it up! :):
Cheers buddy! I need ideas on my next releases ;'D. Any ideas? Or anyone else? lol.
Re: [RP] Bank Robbing System! [SLEDMORE]
Here is little edit to get immediatly credits after succesfully bankrob:
Edit:
Code:
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");
bankRobLooper = null;
bankRobLooper.Abort();
}
Thread.Sleep(1000);
To:
Code:
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);
Without refreshValueables(true, true); player should come again to client to see new amount of hes/her credits.
:P
Re: [RP] Bank Robbing System! [SLEDMORE]
Quote:
Originally Posted by
fetariina
Here is little edit to get immediatly credits after succesfully bankrob:
Edit:
Code:
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");
bankRobLooper = null;
bankRobLooper.Abort();
}
Thread.Sleep(1000);
To:
Code:
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);
Without refreshValueables(true, true); player should come again to client to see new amount of hes/her credits.
:P
Wow, am so dumb, i completely forgot, LOL Cheers, il add you to credits ;').
Re: [RP] Bank Robbing System! [SLEDMORE]
Nice, using Jailbreak functions ;)
Good Work !!
Re: [RP] Bank Robbing System! [SLEDMORE]
Quote:
Originally Posted by
Bjork
Nice, using Jailbreak functions ;)
Good Work !!
Ya, well if its there, you may as well use it ;').
Re: [RP] Bank Robbing System! [SLEDMORE]
can u make clothes or hair dressers shop :) commands thanks :)
Re: [RP] Bank Robbing System! [SLEDMORE]
Re: [RP] Bank Robbing System! [SLEDMORE]
Quote:
Originally Posted by
rangersko
can u make clothes or hair dressers shop :) commands thanks :)
I'l think about that, i got another few commands im working one at first :').
Quote:
Originally Posted by
FCB
Nice Job :)
9/10
Cheers matey.
Re: [RP] Bank Robbing System! [SLEDMORE]
Cheers Sledy Very Good Release Mayb Puts them On Most wanted Page
Re: [RP] Bank Robbing System! [SLEDMORE]
Quote:
Originally Posted by
Habboretromaker
Cheers Sledy Very Good Release Mayb Puts them On Most wanted Page
Glad ya like it Zak ;'D!
Re: [RP] Bank Robbing System! [SLEDMORE]
That will show lollero to stop having frequent periods ;D