[RP][James,]First Command Release! Crack/Drinking Command![RP]

Status
Not open for further replies.

Al-Santoro

New Member
Jan 20, 2011
29
5
Information:
Well, just to inform you, I'm new to C# and I've decided to try out the commands and such, and I've been learning a bit.. And these are the first two commands I made. ;] Hopefully everyone would like it..

Drinking Command!

PHP:
#region :drinking
                    case "drinking":
                       {
                           using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                             
                                dbClient.runQuery("UPDATE users SET health = health - '20' WHERE name = '" + _Username + "'");
                                dbClient.runQuery("UPDATE users SET credits = credits - '0' WHERE name = '" + _Username + "'");
                                Room.sendSaying(roomUser, "*Opens a can of beer, and starts talking randomly, being drunk*");
                                Room.sendSaying(roomUser, "*I... *Hic* I'm in the ultimate flying form!!*");
                                Room.sendSaying(roomUser, "Heyyyyy!! *Hic* I... like..... beerrrrrrrrr!!");
                                Room.sendSaying(roomUser, "*Stops drinking their beer, and still feels cautious*");
                                _Mission = "[Drunk] Be Cautious of this User!";
                                refreshAppearance(false, true, true);
                                sendData("BK" + "You are now drunk!");
                            }
                        }
                        break;
                    #endregion

Crack Command

PHP:
 #region :crack
                    case "crack":
                        {
                            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                                dbClient.runQuery("UPDATE users SET health = health = - '25' WHERE name = '" + _Username + "'");
                                dbClient.runQuery("UPDATE users SET credits = credits = - '0' WHERE name = '" + _Username + "'");
                                Room.sendSaying(roomUser, "*Pulls out their cigar and puts their crack in it*");
                                Room.sendSaying(roomUser, "*Starts lighting up their cigar and starts smoking*");
                                Room.sendSaying(roomUser, "*Starts getting high from smoking and loses 25 HP!*");
                                sendData("BK" + "Aye Mr. Al Capone, you just lost 25 HP and you're high!");
                                _Mission = "[High]This user is high, but be careful, it's worse than you know!";
                                refreshAppearance(false, true, true);
                            }
                        }
                        break;
                    #endregion



C# Code Release Command: v0.1 -- Small Release; Coded from scratch! ;D

More Information:
And I would recommend adding a cooldown to this, otherwise they'll spam the whole room and such.. And tbh, I never worked on making a cooldown for this, since I'm not that advanced to erm, you know... add it in and such.. >_>

Credits:
Al-Santoro - For making both commands.
Live-Jam - For fixing my Drinking command. (Made a slight error).

[mod] Thread moved to Habbo Releases - Ki. [/mod]
 

X1M!

le troller
Jan 6, 2011
179
1
Nice! I like them, but I'd recommend altering the drinking command to only work when they are holding a drink. So gonna use this idea..
 

Kieren

The OGz
Aug 4, 2010
2,957
752
Nice release! a little to easy to be coded thanks for sharing! hope to see more from you!
 

Al-Santoro

New Member
Jan 20, 2011
29
5
Thanks for the comments, and yeh, I'll still continuing my coding journey and such, Lolz. ;D
 

Dayron1234

Rapnameiszero,cuzIhavezero,toleranceforidiots
Jun 30, 2010
772
35
Just to fix up your coding here.....

Code:
#region :drinking
case "drinking":
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{

dbClient.runQuery("UPDATE users SET health = health - '20' WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET credits = credits - '0' WHERE name = '" + _Username + "'");
Room.sendSaying(roomUser, "*Opens a can of beer, and starts talking randomly, being drunk*");
Room.sendSaying(roomUser, "*I... *Hic* I'm in the ultimate flying form!!*");
Room.sendSaying(roomUser, "Heyyyyy!! *Hic* I... like..... beerrrrrrrrr!!");
Room.sendSaying(roomUser, "*Stops drinking their beer, and still feels cautious*");
_Mission = "[Drunk] Be Cautious of this User!";
refreshAppearance(false, true, true);
sendData("BK" + "You are now drunk!");
}
}
break;
#endregion

Code:
region :crack
case "crack":
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET health = health - '25' WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET credits = credits - '0' WHERE name = '" + _Username + "'");
Room.sendSaying(roomUser, "*Pulls out their cigar and puts their crack in it*");
Room.sendSaying(roomUser, "*Starts lighting up their cigar and starts smoking*");
Room.sendSaying(roomUser, "*Starts getting high from smoking and loses 25 HP!*");
sendData("BK" + "Aye Mr. Al Capone, you just lost 25 HP and you're high!");
_Mission = "[High]This user is high, but be careful, it's worse than you know!";
refreshAppearance(false, true, true);
}
}
break;
#endregion

I saw that you had mission where the credits where suppose to be at for example
Code:
dbClient.runQuery("UPDATE users SET mission = credits = - '0' WHERE name = '" + _Username + "'");

Is suppose to be this
Code:
dbClient.runQuery("UPDATE users SET credits = credits - '0' WHERE name = '" + _Username + "'");

Other then that good job for someone that is learning C# and did this from scratch
 

Al-Santoro

New Member
Jan 20, 2011
29
5
Thanks. ;] I'll still continue to work on more commands. Hopefully my C# skills will improve. ;]
 

Al-Santoro

New Member
Jan 20, 2011
29
5
Yeh, I find C# very interesting tbh. ;] That's why I decided to learn it, and plus, it could make RPs become more exciting.
 

Kyle-Santoro

New Member
Jan 24, 2011
17
0
Nice i guess ill release mine aswell
Code:
#region :die
case "die"
{
using (DatabaseClient dbClient=Eucalypt.db.Manager.GetClient () )
{
dbclient.runQuery ("UPDATE user SET health = health - '100' WHERE name = ''' + username + '''''') ;
Room.sendSaying (roomUser, ''*takes a knife out and slits their throat!*");
Room.sendSaying (roomUser, "*falls to the floor in a pile of their blood*");
Room.sendSaying (roomUser, "*is now dead*");
sendData("BK" + "You have now committed suicide you crazy fool!");
_Mission = [Suicide] Dead
refreshAppearance (false, true, true) ;
}
}
break;
Credits:
Kyle-Santoro for making the command
Al-Santoro for helping me figure a few things out & teaching me the basics.
 

Al-Santoro

New Member
Jan 20, 2011
29
5
PHP:
#region :die
case "die": //Edited by James. [Al-Santoro].
{
using (DatabaseClient dbClient = Eucalypt.db.Manager.GetClient())
{
dbclient.runQuery ("UPDATE user SET health = health - '100' WHERE name = '''  + _username + "'") ;
Room.sendSaying (roomUser, ''*takes a knife out and slits their throat!*");
Room.sendSaying (roomUser, "*falls to the floor in a pile of their blood*");
Room.sendSaying (roomUser, "*is now dead*");
sendData("BK" + "You have now committed suicide you crazy fool!");
_Mission = "[Suicide] Dead";
refreshAppearance (false, true, true) ;
}
}
break;

You made some errors on the command. I'll fix it for you. ;D Also, I didn't check the whole command, so I suggest you use C# to find them for you. ;]
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
You err, Should add some sleeps, So it doesn't come out all at the same time instantly.. Such as..

EXAMPLE;
this.Room.sendSaying(roomUser, "lolol testing");
this.Sleep(1000);
this.Room.sendSaying(roomUser, "lolol testing again");

I may of made errors, But I did this quick and fast at school + No longer code. ;). - Nice release.
 
Status
Not open for further replies.

Users who are viewing this thread

Top