ßRÂИÐØИ 47 Posté(e) le 3 janvier 2017 Partager Posté(e) le 3 janvier 2017 Bonjour je vous partage une commande furniture (PlusEmu) #SourceRageZone Elle sert à modifier vos mobis de la table funiture, directement dans votre client. using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.Communication.Packets.Outgoing.Moderation; using Plus.HabboHotel.Items; using Plus.Communication.Packets.Outgoing.Notifications; using Plus.Database.Interfaces; using System.Data; namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator { class FurnitureCommand : IChatCommand { public string PermissionRequired { get { return "command_furniture"; } } public string Parameters { get { return "(Type) (montant)"; } } public string Description { get { return "Correction des mobiliers."; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { RoomUser RUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); List<Item> Items = Room.GetGameMap().GetRoomItemForSquare(RUser.X, RUser.Y); if (Params.Length == 1 || Params[1] == "help") { StringBuilder Lista = new StringBuilder(); Lista.Append("Avertissement : Cette commande sert à modifier vos mobis depuis la table furniture.): \r\r"); Lista.Append("1) :item width number (Edit item witdh) \r"); Lista.Append("2) :item length number (Edit item length) \r"); Lista.Append("3) :item height number (Edit item height) \r"); Lista.Append("4) :item cansit yes/no (Allow / Disallow Sit on the Item) \r"); Lista.Append("5) :item canwalk yes/no (Allow / Disallow Walk on the Item) \r"); Lista.Append("6) :item canstack yes/no (Allow / Disallow Stack on the Item) \r"); Lista.Append("7) :item market yes/no (Allow / Disallow Market place sell) \r"); Lista.Append("8) :item interaction name (Set the Item interaction) \r"); Lista.Append("9) :item interactioncount number (Set the amount of interactions of the Item) \r\r"); Lista.Append("Info : unload votre appart une fois que ton mobis est modifier."); Session.SendMessage(new MOTDNotificationComposer(Lista.ToString())); return; } String Type = Params[1].ToLower(); int numeroint = 0, FurnitureID = 0; double numerodouble = 0; DataRow Item = null; String opcion = ""; switch (Type) { case "width": { try { numeroint = Convert.ToInt32(Params[2]); foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `width` = '" + numeroint + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Item width: " + FurnitureID + " updated (New width: "+numeroint.ToString()+")"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong! (Only valid numbers)"); } } break; case "length": { try { numeroint = Convert.ToInt32(Params[2]); foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `length` = '" + numeroint + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Item length: " + FurnitureID + " updated (New length: " + numeroint.ToString() + ")"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong! (Only valid numbers)"); } } break; case "height": { try { numerodouble = Convert.ToDouble(Params[2]); foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `stack_height` = '" + numerodouble + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Item height: " + FurnitureID + " updated (New height: " + numerodouble.ToString() + ")"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong! (Only valid numbers)"); } } break; case "interactioncount": { try { numeroint = Convert.ToInt32(Params[2]); foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `interaction_modes_count` = '" + numeroint + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Interaction count: " + FurnitureID + " updated (New interaction count: " + numeroint.ToString() + ")"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong! (Only valid numbers)"); } } break; case "cansit": { try { opcion = Params[2].ToLower(); if (!opcion.Equals("yes") && !opcion.Equals("no")) { Session.SendWhisper("Only use yes OR no)"); return; } if (opcion.Equals("yes")) opcion = "1"; else if (opcion.Equals("no")) opcion = "0"; foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `can_sit` = '" + opcion + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Item can_sit: " + FurnitureID + " updated"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong!"); } } break; case "canstack": { try { opcion = Params[2].ToLower(); if (!opcion.Equals("yes") && !opcion.Equals("no")) { Session.SendWhisper("Only use yes OR no)"); return; } if (opcion.Equals("yes")) opcion = "1"; else if (opcion.Equals("no")) opcion = "0"; foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `can_stack` = '" + opcion + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Item can_stack: " + FurnitureID + " updated"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong!"); } } break; case "canwalk": { try { opcion = Params[2].ToLower(); if (!opcion.Equals("yes") && !opcion.Equals("no")) { Session.SendWhisper("Only use yes OR no)"); return; } if (opcion.Equals("yes")) opcion = "1"; else if (opcion.Equals("no")) opcion = "0"; foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `is_walkable` = '" + opcion + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Item can_walk: " + FurnitureID + " updated"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong!"); } } break; case "market": { try { opcion = Params[2].ToLower(); if (!opcion.Equals("yes") && !opcion.Equals("no")) { Session.SendWhisper("Only use yes OR no)"); return; } if (opcion.Equals("yes")) opcion = "1"; else if (opcion.Equals("no")) opcion = "0"; foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `is_rare` = '" + opcion + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Market place option: " + FurnitureID + " updated"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong!"); } } break; case "interaction": { try { opcion = Params[2].ToLower(); foreach (Item IItem in Items.ToList()) { if (IItem == null) continue; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT base_item FROM items WHERE id = '" + IItem.Id + "' LIMIT 1"); Item = dbClient.getRow(); if (Item == null) continue; FurnitureID = Convert.ToInt32(Item[0]); dbClient.RunQuery("UPDATE `furniture` SET `interaction_type` = '" + opcion + "' WHERE `id` = '" + FurnitureID + "' LIMIT 1"); } Session.SendWhisper("Item interaction: "+FurnitureID+" updated. (New interaction: "+opcion+")"); } PlusEnvironment.GetGame().GetItemManager().Init(); } catch (Exception) { Session.SendNotification("Oops! Something wrong!"); } } break; default: { Session.SendNotification("Oops! Something wrong! If you need help, see :item help"); return; }break; } } } } Lien à poster Partager sur d’autres sites Plus d'options de partage...
SnoopyyX42 5 Posté(e) le 3 janvier 2017 Partager Posté(e) le 3 janvier 2017 Merci du partage ! Lien à poster Partager sur d’autres sites Plus d'options de partage...
ßRÂИÐØИ 47 Posté(e) le 3 janvier 2017 Auteur Partager Posté(e) le 3 janvier 2017 Derien amigo :) Lien à poster Partager sur d’autres sites Plus d'options de partage...
SnoopyyX42 5 Posté(e) le 3 janvier 2017 Partager Posté(e) le 3 janvier 2017 il y a 4 minutes, Cali a dit : Derien amigo :) T'inquiète! :') Lien à poster Partager sur d’autres sites Plus d'options de partage...
Moha 21 Posté(e) le 3 janvier 2017 Partager Posté(e) le 3 janvier 2017 Merci du partage ! http://adosquad.fr Lien à poster Partager sur d’autres sites Plus d'options de partage...
Invité Posté(e) le 3 janvier 2017 Partager Posté(e) le 3 janvier 2017 Merci du partage, mais je pense que c'est plus facile de passer par une page php qui fait les modifications directement. Lien à poster Partager sur d’autres sites Plus d'options de partage...
ßRÂИÐØИ 47 Posté(e) le 3 janvier 2017 Auteur Partager Posté(e) le 3 janvier 2017 J'ai corrigé les requêtes et un peu plus traduit : Créer un nouveau .cs nommé FurnitureCommand.cs dans le dossier > HabboHotel > Rooms > Chat > Commands > Moderator Et coller ceci dans le fichier FurnitureCommand.cs : Pour avoir accès à ce lien, merci de vous connecter. Ajouté à CommandManager.cs qui se trouve : HabboHotel > Rooms > Chat > Commands Cherché ceci : private void RegisterModerator() Ajouté ceci : this.Register("item", new FurnitureCommand()); (après le { ) Ajouter ceci à votre base de donnée : INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`, `descriptions`) VALUES ('command_furniture', '9', '0', ''); Modifier le '9' si vous voulez changer le rank minimum ! Enjoy ! Lien à poster Partager sur d’autres sites Plus d'options de partage...
ryadlebg 1 Posté(e) le 3 janvier 2017 Partager Posté(e) le 3 janvier 2017 @Jason bg Lien à poster Partager sur d’autres sites Plus d'options de partage...
michel 0 Posté(e) le 3 janvier 2017 Partager Posté(e) le 3 janvier 2017 Je pense que tu peux modifier ton code pour avoir moins de redondance car quand on regarde ton code tout se ressemble juste quelques petites modifications dans certains cas. Lien à poster Partager sur d’autres sites Plus d'options de partage...
ßRÂИÐØИ 47 Posté(e) le 3 janvier 2017 Auteur Partager Posté(e) le 3 janvier 2017 Il y a 4 heures, michel a dit : Je pense que tu peux modifier ton code pour avoir moins de redondance car quand on regarde ton code tout se ressemble juste quelques petites modifications dans certains cas. Ce n'ai pas mon code, comme je les dis " #SourceRageZone". Lien à poster Partager sur d’autres sites Plus d'options de partage...
NevetS 4 Posté(e) le 2 mars 2017 Partager Posté(e) le 2 mars 2017 Merci du partage ^^ Lien à poster Partager sur d’autres sites Plus d'options de partage...
NevetS 4 Posté(e) le 2 mars 2017 Partager Posté(e) le 2 mars 2017 Le 03/01/2017 à 13:37, Brandon a dit : J'ai corrigé les requêtes et un peu plus traduit : Créer un nouveau .cs nommé FurnitureCommand.cs dans le dossier > HabboHotel > Rooms > Chat > Commands > Moderator Et coller ceci dans le fichier FurnitureCommand.cs : Pour avoir accès à ce lien, merci de vous connecter. Ajouté à CommandManager.cs qui se trouve : HabboHotel > Rooms > Chat > Commands Cherché ceci : private void RegisterModerator() Ajouté ceci : this.Register("item", new FurnitureCommand()); (après le { ) Ajouter ceci à votre base de donnée : INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`, `descriptions`) VALUES ('command_furniture', '9', '0', ''); Modifier le '9' si vous voulez changer le rank minimum ! Enjoy ! Admettons je veux fixé une chaise car ont peut pas s'assoir dessus. Que dois-je écrire comme commande s'il te plait? J'ai essayé 20 fois , j'ai pas réussis! Lien à poster Partager sur d’autres sites Plus d'options de partage...
Scatman 0 Posté(e) le 9 juin 2017 Partager Posté(e) le 9 juin 2017 Le 2/3/2017 à 14:41, NevetS a dit : Admettons je veux fixé une chaise car ont peut pas s'assoir dessus. Que dois-je écrire comme commande s'il te plait? J'ai essayé 20 fois , j'ai pas réussis! :item cansit oui 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