Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Who's Online Command
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Altercationz" data-source="post: 391585" data-attributes="member: 59038"><p>I'm pretty sure he wants to be able to view the users online.</p><p>Here's the command:</p><p>[CODE]</p><p>using System;</p><p>using System.Collections.Generic;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Threading.Tasks;</p><p>using Plus.Database.Interfaces;</p><p>using System.Data;</p><p></p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun</p><p>{</p><p> class WhosOnlineCommand : IChatCommand</p><p> {</p><p> public string PermissionRequired</p><p> {</p><p> get { return "command_whosonline"; }</p><p> }</p><p> public string Parameters</p><p> {</p><p> get { return ""; }</p><p> }</p><p> public string Description</p><p> {</p><p> get { return "Displays the online users"; }</p><p> }</p><p> public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)</p><p> {</p><p> string Output = "Current Users Online";</p><p> Output += "-----------------------\r";</p><p></p><p> using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> Adapter.SetQuery("SELECT FROM users WHERE online = '1'");</p><p> Adapter.RunQuery();</p><p></p><p> DataTable Table = Adapter.getTable();</p><p> if (Table != null)</p><p> {</p><p> foreach (DataRow Row in Table.Rows)</p><p> {</p><p> Output += Row["username"].ToString() + "\r";</p><p> }</p><p> }</p><p> Session.SendNotification(Output);</p><p> }</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="Altercationz, post: 391585, member: 59038"] I'm pretty sure he wants to be able to view the users online. Here's the command: [CODE] 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.User.Fun { class WhosOnlineCommand : IChatCommand { public string PermissionRequired { get { return "command_whosonline"; } } public string Parameters { get { return ""; } } public string Description { get { return "Displays the online users"; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { string Output = "Current Users Online"; Output += "-----------------------\r"; using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { Adapter.SetQuery("SELECT 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"; } } Session.SendNotification(Output); } } } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Who's Online Command
Top