Aller au contenu
  • Veuillez ne pas poster de message pour but d'insulter, incitation à la haine, propos sexuels et tout autre qui ne respecte pas nos conditions générales !

[COMMAND LOT]


Symbiosis

Messages recommandés

Hello tout le monde, vu le temps disponible que j'avais, et l'ennui qui bouillonnait en moi, j'ai développé la commande lot !

Et je décide donc de vous la partager ;)

Donc tout d'abord go dans commandmanager.cs

Et ajoutez donc

                this.Register("givelot", new LotCommand());

Sous

            private void RegisterAdministrator()
            {
				...

Après créer une class nommé LotCommand.cs dans VotreEmulateur\HabboHotel\Rooms\Chat\Commands\Administrator\LotCommand.cs /!\ ajoutez là avec Visual Studio et pas à la main..

Et ajoutez donc dans la class

using Plus.Communication.Packets.Outgoing.Inventory.Furni;
using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Items;
using Plus.Utilities;
using Plus.HabboHotel.Users;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
    class LotCommand : IChatCommand
    { 
        public string PermissionRequired
        {
            get { return "command_lot"; }
        }

        public string Parameters
        {
            get { return "(utilisateur)"; }
        }

        public string Description
        {
            get { return "Permet d'envoyer un lot à un utilisateur"; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Tu n'as pas entré de pseudonyme.", 1);
                return;
            }
            GameClient TargetClient = Game.GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("L'utilisateur n'est pas connecté ou n'existe pas.");
                return;
            }

            if (TargetClient.GetHabbo() == null)
            {
                Session.SendWhisper("L'utilisateur n'est pas connecté ou n'existe pas.");
                return;
            }

            if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
            {
                Session.SendWhisper("Ça va, pas trop égocentrique ? :)");
                return;
            }

            int furniID = RandomNumber.GenerateRandom(1, 10);
            switch (furniID)
            {
                case 1:
                    furniID = Votre id exemple en dessous; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 2:
                    furniID = 0; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 3:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 4:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 5:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 6:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 7:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 8:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 9:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
                case 10:
                    furniID = Votre id; //Insérer un ID (id de l'item dans furniture) 
                    break;
            }
            Habbo Habbo = PlusEnvironment.GetHabboByUsername(Params[1]);
            string Username = Habbo.Username;
            GameClient Target = Game.GetClientManager().GetClientByUsername(Username);
            ItemData furni = null;
            if (Game.GetItemManager().GetItem(furniID, out furni))
            {
                Item purchasefurni = ItemFactory.CreateSingleItemNullable(furni, Target.GetHabbo(), "", "");
                if (purchasefurni != null)
                {
                    Session.SendWhisper("Le lot vient d'être envoyé");
                    Target.GetHabbo().GetInventoryComponent().TryAddItem(purchasefurni);
                    Target.SendMessage(new FurniListNotificationComposer(purchasefurni.Id, 1));
                    Target.SendMessage(new FurniListUpdateComposer());
                    Target.SendBubble("Tu as reçu ton lot par " + Session.GetHabbo().Username, "cadeau");
                }
            }
        }
    }
}


Maintenant côté db !
Ajoutez ça 

 

INSERT INTO `permissions_commands` VALUES ('command_lot', '6', '0');

Bonne utilisation ;)

Si tu souhaites contribuer à ma motivation, aides-moi en réagissant à mes postes un +1 me ferait réellement plaisir !

 

Site web pour mon émulateur: https://habbo.site/

  • J'aime 2
  • Haha 1
Lien à poster
Partager sur d’autres sites

il y a 1 minute, Lucas Orsini a dit :

Quand j'étais jeune et innocent!

Je rêvais d'avoir ce genre de commande comme Habboz, c'était des exemples avant pour moi :tok-4283c:

Aha, j'espère que ton rêve a été réalisé, ou qu'il va l'être grâce au partage

Si tu souhaites contribuer à ma motivation, aides-moi en réagissant à mes postes un +1 me ferait réellement plaisir !

 

Site web pour mon émulateur: https://habbo.site/

Lien à poster
Partager sur d’autres sites

up! à remplacer Game. par -> PlusEnvironment.GetGame(). et pour la notification bubble:

 

        public static ServerPacket SendBubble(string image, string message, string linkUrl = "")
        {
            var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer);
            bubbleNotification.WriteString(image = "advice");

            bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3);
            bubbleNotification.WriteString("display");
            bubbleNotification.WriteString("BUBBLE");
            bubbleNotification.WriteString("message");
            bubbleNotification.WriteString(message);

            if (string.IsNullOrEmpty(linkUrl))
                return bubbleNotification;

            bubbleNotification.WriteString("linkUrl");
            bubbleNotification.WriteString(linkUrl);
            return bubbleNotification;
        }

 

à mettre:

 

Target.SendMessage(RoomNotificationComposer.SendBubble("cadeau", "Tu as reçu ton lot par " +Session.GetHabbo().Username, "");

 

enjoy. merci pour le partage coupin

meeeeeh

Lien à poster
Partager sur d’autres sites

Il y a 3 heures, DownPipe a dit :

up! à remplacer Game. par -> PlusEnvironment.GetGame(). et pour la notification bubble:

 

        public static ServerPacket SendBubble(string image, string message, string linkUrl = "")
        {
            var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer);
            bubbleNotification.WriteString(image = "advice");

            bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3);
            bubbleNotification.WriteString("display");
            bubbleNotification.WriteString("BUBBLE");
            bubbleNotification.WriteString("message");
            bubbleNotification.WriteString(message);

            if (string.IsNullOrEmpty(linkUrl))
                return bubbleNotification;

            bubbleNotification.WriteString("linkUrl");
            bubbleNotification.WriteString(linkUrl);
            return bubbleNotification;
        }

 

à mettre:

 


Target.SendMessage(RoomNotificationComposer.SendBubble("cadeau", "Tu as reçu ton lot par " +Session.GetHabbo().Username, "");

 

enjoy. merci pour le partage coupin

Merci, pour le code, j'avais pas pensé que la structure de mon émulateur n'était pas pareil ! aha de rien ;)

Si tu souhaites contribuer à ma motivation, aides-moi en réagissant à mes postes un +1 me ferait réellement plaisir !

 

Site web pour mon émulateur: https://habbo.site/

Lien à poster
Partager sur d’autres sites

Le 23/11/2017 à 12:17, DownPipe a dit :

up! à remplacer Game. par -> PlusEnvironment.GetGame(). et pour la notification bubble:

 

        public static ServerPacket SendBubble(string image, string message, string linkUrl = "")
        {
            var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer);
            bubbleNotification.WriteString(image = "advice");

            bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3);
            bubbleNotification.WriteString("display");
            bubbleNotification.WriteString("BUBBLE");
            bubbleNotification.WriteString("message");
            bubbleNotification.WriteString(message);

            if (string.IsNullOrEmpty(linkUrl))
                return bubbleNotification;

            bubbleNotification.WriteString("linkUrl");
            bubbleNotification.WriteString(linkUrl);
            return bubbleNotification;
        }

 

à mettre:

 


Target.SendMessage(RoomNotificationComposer.SendBubble("cadeau", "Tu as reçu ton lot par " +Session.GetHabbo().Username, "");

 

enjoy. merci pour le partage coupin

Je comprends pas, faut remplacer

 

        public static ServerPacket SendBubble(string image, string message, string linkUrl = "")
        {
            var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer);
            bubbleNotification.WriteString(image = "advice");

            bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3);
            bubbleNotification.WriteString("display");
            bubbleNotification.WriteString("BUBBLE");
            bubbleNotification.WriteString("message");
            bubbleNotification.WriteString(message);

            if (string.IsNullOrEmpty(linkUrl))
                return bubbleNotification;

            bubbleNotification.WriteString("linkUrl");
            bubbleNotification.WriteString(linkUrl);
            return bubbleNotification;
        }

 

 par

 

Target.SendMessage(RoomNotificationComposer.SendBubble("cadeau", "Tu as reçu ton lot par " +Session.GetHabbo().Username, "");

 ?

Résultat de recherche d'images pour "alltta 20syl & mr j medeiros under"

Lien à poster
Partager sur d’autres sites

à mettre dans RoomNotificationComposer -> 

       public static ServerPacket SendBubble(string image, string message, string linkUrl = "")
        {
            var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer);
            bubbleNotification.WriteString(image = "advice");

            bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3);
            bubbleNotification.WriteString("display");
            bubbleNotification.WriteString("BUBBLE");
            bubbleNotification.WriteString("message");
            bubbleNotification.WriteString(message);

            if (string.IsNullOrEmpty(linkUrl))
                return bubbleNotification;

            bubbleNotification.WriteString("linkUrl");
            bubbleNotification.WriteString(linkUrl);
            return bubbleNotification;
        }

 

puis aller dans la commande LotCommand remplacé çar Game. par -> PlusEnvironmet.GetGame()

 

 

après à la place de la notification tu met ça:

 

Target.SendMessage(RoomNotificationComposer.SendBubble("cadeau", "Tu as reçu ton lot par " +Session.GetHabbo().Username, "");

meeeeeh

Lien à poster
Partager sur d’autres sites

  • 2 mois plus tard...
  • 7 mois plus tard...
  • 4 ans plus tard...

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant
×
×
  • Créer...