FAQ, Handitem command (PLUSEMU)

Results 1 to 10 of 10
  1. #1
    Proficient Member JerryCool is offline
    MemberRank
    Jul 2013 Join Date
    ChicagoLocation
    154Posts

    FAQ, Handitem command (PLUSEMU)

    I'll be releasing a few more commands if it's useful or not.

    • FAQ
    • HandItem

    Handitem:
    Code:
                    #region handitem (:handitem <id>)
                    case "handitem":
                        {
                            if (Session.GetHabbo().HasCmd("handitem"))
                            {
                                Room currentRoom = Session.GetHabbo().CurrentRoom;
                                RoomUser roomUserByHabbo = null;
                                currentRoom = SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                if (currentRoom != null)
                                {
                                    roomUserByHabbo = currentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    if (roomUserByHabbo != null)
                                    {
                                        try
                                        {
                                            roomUserByHabbo.CarryItem(int.Parse(Params[1]));
                                        }
                                        catch
                                        {
                                        }
                                    }
                                }
                            }
            return true;
            }                 #endregion

    FAQ:
    Code:
                    #region FAQ (:faq)
                    case "faq":
                        {
                            if (Session.GetHabbo().HasCmd("faq"))
                            {
                                DataTable table;
                                Room currentRoom = Session.GetHabbo().CurrentRoom;
                                using (IQueryAdapter adapter = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
                                {
                                    adapter.setQuery("SELECT question, answer FROM faq");
                                    table = adapter.getTable();
                                }
                                StringBuilder builder = new StringBuilder();
                                builder.Append(" - FAQ - \r\r");
                                foreach (DataRow row in table.Rows)
                                {
                                    builder.Append("Q: " + ((string)row["question"]) + "\r");
                                    builder.Append("A: " + ((string)row["answer"]) + "\r\r");
                                }
                                Session.SendNotif(builder.ToString());
                            }
                            return true;
                        }
                       
                       #endregion

    SQL FOR FAQ:
    Code:
    -- ----------------------------
    -- Table structure for `faq`
    -- ----------------------------
    DROP TABLE IF EXISTS `faq`;
    CREATE TABLE `faq` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `question` text NOT NULL,
      `answer` text NOT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `id` (`id`) USING BTREE
    ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
    
    -- ----------------------------
    -- Records of faq
    -- ----------------------------
    INSERT INTO `faq` VALUES ('1', 'How can I be staff?', 'Be active, help users, advertise and more');
    INSERT INTO `faq` VALUES ('2', 'Can I have more credits?', 'No, you get 500c every 15 minutes');
    INSERT INTO `faq` VALUES ('3', 'Can I have a rare?', 'Hell no');
    INSERT INTO `faq` VALUES ('4', 'Can I have more duckets?', 'No, you get 100 duckets every 15 minutes');
    INSERT INTO `faq` VALUES ('5', 'When will pets get released?', 'They are allready in the catalog.');
    INSERT INTO `faq` VALUES ('6', 'Can staff come and advertise my room?', 'Sometimes..');
    INSERT INTO `faq` VALUES ('7', 'Can I be friend with staff?', 'Sure, as long you do not beg :D'); INSERT INTO `faq` VALUES ('8', 'Can I have a badge?', 'No, there is a badgeshop feature on your website, check it out :D');

    SQL for fuse_cmds:
    Code:
    INSERT INTO `fuse_cmds` VALUES ('86', 'handitem', '1', '%id%', 'Gives you the chosen item');
    INSERT INTO `fuse_cmds` VALUES ('87', 'faq', '1', null, 'It gives you the answers you might need');


    Screenshots;


    Credits:
    JerryCool - Fixed coding for PlusEMU.
    SwiftEMU - Taking their code from the source.









  2. #2
    is it me or is it just .. duckietm is offline
    MemberRank
    Oct 2010 Join Date
    339Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Thanks !

  3. #3
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,610Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Yay lets spam the database with :faq

  4. #4
    ส็็็็็็็ Bloodraven is offline
    MemberRank
    Sep 2009 Join Date
    AntarcticaLocation
    2,414Posts

    Re: FAQ, Handitem command (PLUSEMU)

    It'd be difficult to spam the database. Spam filter...

  5. #5
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,610Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Quote Originally Posted by Bloodraven View Post
    It'd be difficult to spam the database. Spam filter...
    Don''t think commands are blocked by spam filter.

    But it is more friendly to cache it a single time.

  6. #6
    ~|=_=|~ Receiver is offline
    MemberRank
    Sep 2013 Join Date
    PlutoLocation
    624Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Thank's for the handitem command but, i wouldn't be using the faq command as the one above me said you can spam it and cause yourself into more problems.

  7. #7
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,610Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Quote Originally Posted by Receiver View Post
    Thank's for the handitem command but, i wouldn't be using the faq command as the one above me said you can spam it and cause yourself into more problems.
    Change it to a static list and load it when the emulator is started :)

  8. #8
    ส็็็็็็็ Bloodraven is offline
    MemberRank
    Sep 2009 Join Date
    AntarcticaLocation
    2,414Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Quote Originally Posted by Username Here View Post
    Don''t think commands are blocked by spam filter.

    But it is more friendly to cache it a single time.
    Ahh, I suppose it would be pretty easy to have commands be filtered with the spam filter.

    I wouldn't even use an FAQ command, having it on the web-side would be better.

  9. #9
    Alpha Member Twan is offline
    MemberRank
    Jun 2010 Join Date
    1,961Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Well, thanks for these commands!

  10. #10
    Proficient Member JerryCool is offline
    MemberRank
    Jul 2013 Join Date
    ChicagoLocation
    154Posts

    Re: FAQ, Handitem command (PLUSEMU)

    Thanks for all your feedback's and I see a few hotels using the FAQ..



Advertisement