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;
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;
-EDIT-
The :bankrob command!
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 ;')
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 ;')