Nico 41 Posted July 18, 2017 Share Posted July 18, 2017 Bonjour, Je vient vous faire un petit partage. Je précise que cette commande n'est pas de moi elle provient d'un forum étranger. Vous avez juste à créer un fichier OnlineCommand.cs avec ceci dedans: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Plus.Database.Interfaces; using System.Data; namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator.Fun { class UsersOnlineCommand : IChatCommand { public string PermissionRequired { get { return "command_usersonline"; } } public string Parameters { get { return ""; } } public string Description { get { return "Affiche les utilisateurs en ligne"; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { string Output = "Utilisateurs actuels en ligne:\r"; Output += "-----------------------\r"; using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { Adapter.SetQuery("SELECT username FROM users WHERE online = '1'"); Adapter.RunQuery(); DataTable Table = Adapter.getTable(); if (Table != null) { foreach (DataRow Row in Table.Rows) { Output += Row["Username"].ToString() + "\r"; } } else { Output += "Il doit y avoir des utilisateurs cachés en ligne!"; } } Session.SendNotification(Output); } } } Et ajouter cette ligne dans CommandManager.cs this.Register("online", new UsersOnlineCommand()); Et d’exécuter cette requête SQL dans votre DB INSERT INTO `permissions_commands` VALUES ('command_online', '1', '0'); Voilà bonne journée à vous Besoin d'une ressource pour ton rétro ? Un CMS ? Un Addon ? Besoin d'une base de donnée pour ton rétro ? Un dédipass une base de donnée pendant 4 mois ! Alors rejoins moi vite sur http://comahost.com https://www.facebook.com/comahost/ Les crocodiles en force ! Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2017 Share Posted July 18, 2017 Ahaha merci du partage Nico Link to comment Share on other sites More sharing options...
Nico 41 Posted July 18, 2017 Author Share Posted July 18, 2017 il y a 23 minutes, KrackWeed a dit : Ahaha merci du partage Nico Pas de problème mon ami Besoin d'une ressource pour ton rétro ? Un CMS ? Un Addon ? Besoin d'une base de donnée pour ton rétro ? Un dédipass une base de donnée pendant 4 mois ! Alors rejoins moi vite sur http://comahost.com https://www.facebook.com/comahost/ Les crocodiles en force ! Link to comment Share on other sites More sharing options...
Logic 30 Posted July 18, 2017 Share Posted July 18, 2017 part pitier pq une requête ? autant remplacé par ça : Dictionary<Habbo, UInt32> clients = new Dictionary<Habbo, UInt32>(); StringBuilder content = new StringBuilder(); content.Append("- JOUEUR EN LIGNE -\r\n"); foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList()) { if (client == null) continue; content.Append("¥ " + client.GetHabbo().Username + " » Est dans l'appart: " + ((client.GetHabbo().CurrentRoom == null) ? "Dans aucun appart." : client.GetHabbo().CurrentRoom.RoomData.Name) + "\r\n"); } Session.SendMessage(new MOTDNotificationComposer(content.ToString())); return; meeeeeh Link to comment Share on other sites More sharing options...
Nico 41 Posted July 18, 2017 Author Share Posted July 18, 2017 il y a 20 minutes, Cipher a dit : part pitier pq une requête ? autant remplacé par ça : Dictionary<Habbo, UInt32> clients = new Dictionary<Habbo, UInt32>(); StringBuilder content = new StringBuilder(); content.Append("- JOUEUR EN LIGNE -\r\n"); foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList()) { if (client == null) continue; content.Append("¥ " + client.GetHabbo().Username + " » Est dans l'appart: " + ((client.GetHabbo().CurrentRoom == null) ? "Dans aucun appart." : client.GetHabbo().CurrentRoom.RoomData.Name) + "\r\n"); } Session.SendMessage(new MOTDNotificationComposer(content.ToString())); return; Comme je l'ai dit ce n'est pas de moi je fait juste un repartage ... Besoin d'une ressource pour ton rétro ? Un CMS ? Un Addon ? Besoin d'une base de donnée pour ton rétro ? Un dédipass une base de donnée pendant 4 mois ! Alors rejoins moi vite sur http://comahost.com https://www.facebook.com/comahost/ Les crocodiles en force ! Link to comment Share on other sites More sharing options...
ßRÂИÐØИ 46 Posted July 18, 2017 Share Posted July 18, 2017 Il y a 2 heures, Cipher a dit : part pitier pq une requête ? autant remplacé par ça : Dictionary<Habbo, UInt32> clients = new Dictionary<Habbo, UInt32>(); StringBuilder content = new StringBuilder(); content.Append("- JOUEUR EN LIGNE -\r\n"); foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList()) { if (client == null) continue; content.Append("¥ " + client.GetHabbo().Username + " » Est dans l'appart: " + ((client.GetHabbo().CurrentRoom == null) ? "Dans aucun appart." : client.GetHabbo().CurrentRoom.RoomData.Name) + "\r\n"); } Session.SendMessage(new MOTDNotificationComposer(content.ToString())); return; Foreach power !! Sinon merci du partage @Nico Link to comment Share on other sites More sharing options...
Nico 41 Posted July 18, 2017 Author Share Posted July 18, 2017 il y a 10 minutes, Brandon a dit : Foreach power !! Sinon merci du partage @Nico Tqt pas de soucis Besoin d'une ressource pour ton rétro ? Un CMS ? Un Addon ? Besoin d'une base de donnée pour ton rétro ? Un dédipass une base de donnée pendant 4 mois ! Alors rejoins moi vite sur http://comahost.com https://www.facebook.com/comahost/ Les crocodiles en force ! Link to comment Share on other sites More sharing options...
Logic 30 Posted July 18, 2017 Share Posted July 18, 2017 YEAA foreach power meeeeeh Link to comment Share on other sites More sharing options...
yel0x 3 Posted December 16, 2017 Share Posted December 16, 2017 Non fonctionnel Link to comment Share on other sites More sharing options...
Logic 30 Posted December 16, 2017 Share Posted December 16, 2017 Yel0x vient privée. meeeeeh Link to comment Share on other sites More sharing options...
נσα¢кιм 6 Posted December 16, 2017 Share Posted December 16, 2017 Un screenshot de ce que ça donne? Au passage, merci à toi & Cipher Link to comment Share on other sites More sharing options...
TuesdayATB 45 Posted January 25, 2018 Share Posted January 25, 2018 2 erreurs toutes bêtes mais importantes qui font que la commande ne marche pas : Probléme de dossiers Remplacer namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator.Fun Par namespace Plus.HabboHotel.Rooms.Chat.Commands.User Mettre le fichier OnlineCommand.cs dans le dossier de votre émulateur > HabboHotel > Rooms > Chat > Commands > User 2. Cette fois ci probléme de permissions dans la base de donnée Remplacer public string PermissionRequired { get { return "command_usersonline"; } } Par public string PermissionRequired { get { return "command_online"; } } Et c'était tout je pense. Derien Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now