Service - command coding

Status
Not open for further replies.
Mercury

:mypg

(Show your credits, duckets, diamonds, motto, id, respects ecc ecc..




from rank 1

Code:
                    case "mypg":
                    case "overmij":
                        {
                            if (this.Session.GetHabbo().Rank > 0) // The minimum rank you want -1. Made by Weed aka AskethZ
                            {
                                this.Session.SendNotif("<font size=\"22px\">- My PG -</font><br><b>User ID</b>: " + this.Session.GetHabbo().Id + "<br><b>Username</b>: " + this.Session.GetHabbo().Username + "<br><b>Motto</b>: " + this.Session.GetHabbo().Motto + "<br><b>Credits</b>: " + this.Session.GetHabbo().Credits + "<br><b>Duckets</b>: " + this.Session.GetHabbo().ActivityPoints + "<br><b>Diamonds</b>: " + this.Session.GetHabbo().BelCredits + "<br><b>Respects</b>: " + this.Session.GetHabbo().Respect + "<br><b>Rank</b>: " + this.Session.GetHabbo().Rank + "");
                                return true;
                            }
                            {
                                this.Session.SendWhisper("You are not allowed to perform this command");
                                return true;
                            }
                        }

if anyone asks why im making these commands in stead of the thread-starter.
first, i want to learn C# to the max, so I learn by doing.
second, the thread-starting doesn't make any commands :p.
( I only make Mercury commands )

Loves, :blushing:
AskethZ aka Weed
 
Code:
                    case "mypg":
                    case "overmij":
                        {
                            if (this.Session.GetHabbo().Rank > 0) // The minimum rank you want -1. Made by Weed aka AskethZ
                            {
                                this.Session.SendNotif("<font size=\"22px\">- My PG -</font><br><b>User ID</b>: " + this.Session.GetHabbo().Id + "<br><b>Username</b>: " + this.Session.GetHabbo().Username + "<br><b>Motto</b>: " + this.Session.GetHabbo().Motto + "<br><b>Credits</b>: " + this.Session.GetHabbo().Credits + "<br><b>Duckets</b>: " + this.Session.GetHabbo().ActivityPoints + "<br><b>Diamonds</b>: " + this.Session.GetHabbo().BelCredits + "<br><b>Respects</b>: " + this.Session.GetHabbo().Respect + "<br><b>Rank</b>: " + this.Session.GetHabbo().Rank + "");
                                return true;
                            }
                            {
                                this.Session.SendWhisper("You are not allowed to perform this command");
                                return true;
                            }
                        }

if anyone asks why im making these commands in stead of the thread-starter.
first, i want to learn C# to the max, so I learn by doing.
second, the thread-starting doesn't make any commands :p.
( I only make Mercury commands )

Loves, :blushing:
AskethZ aka Weed

This even valid C#? Proof of working cos you don't use the else-keyword. Also the condition is logically always true so it makes it redundant.
 
:adv (message)
For mercury emulator

(It sends an alert paying automatically 20.000 duckets, if you have less than 20.000 an alert says you that you must have more duckets. Like the command :superha without image and for all users with 20.000 duckets)..


Structure:
"Hotel alert" (written above the message);
Message;
<br> <br>
-Username of user who sended it
<br> <br>
-"Adv" (written after the message)
Rank: 1


Thanks, hope you'll be able to make this :)
 
Last edited:
This even valid C#? Proof of working cos you don't use the else-keyword. Also the condition is logically always true so it makes it redundant.

Once again, I'm learning. Tho the command does its work



:adv (message)
For mercury emulator

(It sends an alert paying automatically 20.000 duckets, if you have less than 20.000 an alert says you that you must have more duckets. Like the command :superha without image and for all users with 20.000 duckets)..


Structure:
"Hotel alert" (written above the message);
Message;
<br> <br>
-Username of user who sended it
<br> <br>
-"Adv" (written after the message)
Rank: 1


Thanks, hope you'll be able to make this :)

Try this
Code:
                    case "adv":
                        {
                            if (!this.Session.GetHabbo().GotCommand("adv"))
                            {
                                this.Session.SendWhisper("You can not perform this command");
                                return true;
                            }
                            else
                            {
                                if (this.Session.GetHabbo().ActivityPoints < 20000)
                                {
                                    this.Session.SendWhisper("You do not have enough duckets to perform this command. (20,000 required)");
                                    return true;
                                }
                                else
                                {
                                    string detekst = MergeParams(Params, 1);
                                    ServerMessage verstjuren = new ServerMessage(Outgoing.BroadcastNotifMessageComposer);
                                    verstjuren.AppendString(detekst + "\r\n- " + this.Session.GetHabbo().Username + "/r/n<b>ADV</b>");
                                    MercuryEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(verstjuren);
                                    this.Session.GetHabbo().ActivityPoints -= 20000;
                                    this.Session.GetHabbo().UpdateActivityPointsBalance();
                                }
                            }
                        }
 
Last edited:
Once again, I'm learning. Tho the command does its work





Try this
Code:
                    case "adv":
                        {
                            if (!this.Session.GetHabbo().GotCommand("adv"))
                            {
                                this.Session.SendWhisper("You can not perform this command");
                                return true;
                            }
                            else
                            {
                                if (this.Session.GetHabbo().ActivityPoints < 20000)
                                {
                                    this.Session.SendWhisper("You do not have enough duckets to perform this command. (20,000 required)");
                                    return true;
                                }
                                else
                                {
                                    string detekst = MergeParams(Params, 1);
                                    ServerMessage verstjuren = new ServerMessage(Outgoing.BroadcastNotifMessageComposer);
                                    verstjuren.AppendString(detekst + "\r\n- " + this.Session.GetHabbo().Username + "/r/n<b>ADV</b>");
                                    WeedEMUEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(verstjuren);
                                    this.Session.GetHabbo().ActivityPoints -= 20000;
                                    this.Session.GetHabbo().UpdateActivityPointsBalance();
                                }
                            }
                        }
Thanks, but my C# Visual gives me a lot of errors.
 
Once again, I'm learning. Tho the command does its work





Try this
Code:
                    case "adv":
                        {
                            if (!this.Session.GetHabbo().GotCommand("adv"))
                            {
                                this.Session.SendWhisper("You can not perform this command");
                                return true;
                            }
                            else
                            {
                                if (this.Session.GetHabbo().ActivityPoints < 20000)
                                {
                                    this.Session.SendWhisper("You do not have enough duckets to perform this command. (20,000 required)");
                                    return true;
                                }
                                else
                                {
                                    string detekst = MergeParams(Params, 1);
                                    ServerMessage verstjuren = new ServerMessage(Outgoing.BroadcastNotifMessageComposer);
                                    verstjuren.AppendString(detekst + "\r\n- " + this.Session.GetHabbo().Username + "/r/n<b>ADV</b>");
                                    WeedEMUEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(verstjuren);
                                    this.Session.GetHabbo().ActivityPoints -= 20000;
                                    this.Session.GetHabbo().UpdateActivityPointsBalance();
                                }
                            }
                        }

These commands are great. Any chance to make them for GTE, the phoenix edit :)
 
These commands are great. Any chance to make them for GTE, the phoenix edit :)

Thanks a lot bro! No I'm very sorry, currently only writing for Mercury/Plus R2.
Maybe in the future tho!



Thanks, but my C# Visual gives me a lot of errors.

Mercury right? If so, there should be no problemo.



Thanks, but my C# Visual gives me a lot of errors.

OH W8 Sorry! My bad. This should do it:
Code:
                    case "adv":
                        {
                            if (!this.Session.GetHabbo().GotCommand("adv"))
                            {
                                this.Session.SendWhisper("You can not perform this command");
                                return true;
                            }
                            else
                            {
                                if (this.Session.GetHabbo().ActivityPoints < 20000)
                                {
                                    this.Session.SendWhisper("You do not have enough duckets to perform this command. (20,000 required)");
                                    return true;
                                }
                                else
                                {
                                    string detekst = MergeParams(Params, 1);
                                    ServerMessage verstjuren = new ServerMessage(Outgoing.BroadcastNotifMessageComposer);
                                    verstjuren.AppendString(detekst + "\r\n- " + this.Session.GetHabbo().Username + "/r/n<b>ADV</b>");
                                    MercuryEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(verstjuren);
                                    this.Session.GetHabbo().ActivityPoints -= 20000;
                                    this.Session.GetHabbo().UpdateActivityPointsBalance();
                                }
                                return true;
                            }
                        }



This even valid C#? Proof of working cos you don't use the else-keyword. Also the condition is logically always true so it makes it redundant.

I just set that if(this.Session.GetHabbo().Rank < 0) there so that you can change the rank if you deside only, idk, donators can do it.
 
Last edited:
These commands are great. Any chance to make them for GTE, the phoenix edit :)

The ADV for GTE, should work with this code

In ChatCommandHandler.cs
Code:
case 123:
                                {
                                    if (!Session.GetHabbo().HasFuse("cmd_ha"))
                                    {
                                        Session.GetHabbo().Whisper("Vous n'avez pas les permissions pour effectuer cette commande.");
                                        return true;
                                    }
                                    else
                                    {
                                        if (Session.GetHabbo().ActivityPoints < 20000)
                                        {
                                            Session.GetHabbo().Whisper("Vous n'avez pas assez de pixels. (20,000 requis)");
                                            return true;
                                        }
                                        else
                                        {
                                            string str = Input.Substring(4);
                                            ServerMessage Message2 = new ServerMessage(808u);
                                            Message2.AppendStringWithBreak(GoldTreeEnvironment.GetExternalText("cmd_ha_title"));
                                            Message2.AppendStringWithBreak(str + "\r\n- " + Session.GetHabbo().Username);
                                            ServerMessage Message3 = new ServerMessage(161u);
                                            Message3.AppendStringWithBreak(str + "\r\n- " + Session.GetHabbo().Username);
                                            GoldTree.GetGame().GetClientManager().method_15(Message2, Message3);
                                            Session.GetHabbo().ActivityPoints -= 20000;
                                            Session.GetHabbo().UpdateActivityPoints(true);
                                            return true;
                                        }
                                    }
                                }

In RoleManager.cs

Code:
this.dictionary_4.Add("adv", 123);

Code:
if (GoldTree.StringToBoolean(dataRow["cmd_adv"].ToString()))
                    {
                        list.Add("cmd_adv");
                    }


Add a line on permissions_users and permissions_ranks with "cmd_adv" on your DB
 
Last edited:
@
AskethZ thanks again but after writing ":adv message" always saying me "You can not perform this command" even if I have 212212 duckets and 21922299 diamonds.​

I'll rewrite it, some more organised, one moment.

UPDATE:
Code:
                    case "adv":
                        {
                            if (this.Session.GetHabbo().Rank <= 1) // ur minimum rank here
                            {
                                this.Session.SendWhisper("Je mag dit niet");
                                return true;
                            }
                            else
                            {
                                if (this.Session.GetHabbo().ActivityPoints < 20000)
                                {
                                    this.Session.SendWhisper("Je hebt niet genoeg Duckets. (20,000 nodig)");
                                    return true;
                                }
                                else
                                {
                                    string detekst = MergeParams(Params, 1);
                                    ServerMessage verstjuren = new ServerMessage(Outgoing.BroadcastNotifMessageComposer);
                                    verstjuren.AppendString(detekst + "\r\n- " + this.Session.GetHabbo().Username + "/r/n<b>ADV</b>");
                                    MercuryEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(verstjuren);
                                    this.Session.GetHabbo().ActivityPoints -= 20000;
                                    this.Session.GetHabbo().UpdateActivityPointsBalance();
									return true;
                                }
                            }
                        }
 
Last edited:
Status
Not open for further replies.
Back