Symbiosis 38 Posté(e) le 22 novembre 2017 Partager Posté(e) le 22 novembre 2017 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/ 2 1 Lien à poster Partager sur d’autres sites Plus d'options de partage...
Invité Posté(e) le 22 novembre 2017 Partager Posté(e) le 22 novembre 2017 Quand j'étais jeune et innocent! Je rêvais d'avoir ce genre de commande comme Habboz, c'était des exemples avant pour moi Lien à poster Partager sur d’autres sites Plus d'options de partage...
Symbiosis 38 Posté(e) le 22 novembre 2017 Auteur Partager Posté(e) le 22 novembre 2017 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 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 Plus d'options de partage...
Logic 30 Posté(e) le 23 novembre 2017 Partager Posté(e) le 23 novembre 2017 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 Plus d'options de partage...
Symbiosis 38 Posté(e) le 23 novembre 2017 Auteur Partager Posté(e) le 23 novembre 2017 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 Plus d'options de partage...
TuesdayATB 50 Posté(e) le 26 novembre 2017 Partager Posté(e) le 26 novembre 2017 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, ""); ? Lien à poster Partager sur d’autres sites Plus d'options de partage...
Logic 30 Posté(e) le 26 novembre 2017 Partager Posté(e) le 26 novembre 2017 à 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 Plus d'options de partage...
ZaYor 6 Posté(e) le 22 février 2018 Partager Posté(e) le 22 février 2018 Un screen ou un gif serait pas de refus Lien à poster Partager sur d’autres sites Plus d'options de partage...
Cryzy 0 Posté(e) le 23 février 2018 Partager Posté(e) le 23 février 2018 (modifié) Merci pour le partage ! Modifié le 23 février 2018 par Wurov2 Lien à poster Partager sur d’autres sites Plus d'options de partage...
Javas 0 Posté(e) le 3 octobre 2018 Partager Posté(e) le 3 octobre 2018 Perfect tutorial Lien à poster Partager sur d’autres sites Plus d'options de partage...
mielpopsdu51 0 Posté(e) le 15 novembre 2022 Partager Posté(e) le 15 novembre 2022 bbb Lien à poster Partager sur d’autres sites Plus d'options de partage...
Luna 11 Posté(e) le 23 novembre 2022 Partager Posté(e) le 23 novembre 2022 Lien à poster Partager sur d’autres sites Plus d'options de partage...
Messages recommandés
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 compteSe connecter
Vous avez déjà un compte ? Connectez-vous ici.
Connectez-vous maintenant