[UberEmu] RoomPolls!!

Results 1 to 15 of 15
  1. #1
    League of Legends <3 toperwin is offline
    MemberRank
    Jan 2009 Join Date
    313Posts

    [UberEmu] RoomPolls!!

    Tutorial:
    GoTo: /HabboHotel/Misc/CharCommandHandler.cs
    Search for:
    PHP Code:
    case "ha"
    Add above it:
    PHP Code:
                        #region startpoll
                        
    case "startpoll":
                            {
                                if (
    Session.GetHabbo().HasFuse("fuse_sysadmin"))
                                {
                                    try
                                    {
                                        
    int PollID 0;
                                        
    string PollMsg "";

                                        
    using (Storage.DatabaseClient dbClient UberEnvironment.GetDatabase().GetClient())
                                        {
                                            
    PollID dbClient.ReadInt32("SELECT id FROM room_poll WHERE room = '" Session.GetHabbo().CurrentRoomId "' LIMIT 1");
                                            
    PollMsg dbClient.ReadString("SELECT message FROM room_poll WHERE room = '" Session.GetHabbo().CurrentRoomId "' LIMIT 1");
                                        }

                                        
    ServerMessage NewPoll = new ServerMessage(316);
                                        
    NewPoll.AppendInt32(PollID);
                                        
    NewPoll.AppendStringWithBreak(PollMsg);
                                        
    Session.GetHabbo().CurrentRoom.SendMessage(NewPoll);
                                    }
                                    catch (
    NullReferenceException)
                                    {
                                        
    Session.SendNotif("Sorry, this room doesn't have any poll's yet!");
                                        return 
    false;
                                    }
                                }
                            }
                            return 
    false;
                        
    #endregion 
    Goto: /Messages/Requests/Users.cs
    Search for:
    PHP Code:
    public void RegisterUsers() 
    Add above it:
    PHP Code:
            private void RoomPollSystem()
            {
                
    DataTable Data null;

                
    using (DatabaseClient dbClient UberEnvironment.GetDatabase().GetClient())
                {
                    
    Data dbClient.ReadDataTable("SELECT * FROM room_poll WHERE room = '" Session.GetHabbo().CurrentRoomId "' LIMIT 1");
                }

                if (
    Data == null)
                {
                    return;
                }

                foreach (
    DataRow Row in Data.Rows)
                {
                    
    GetResponse().Init(317);
                    
    GetResponse().AppendInt32((int)Row["id"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question"]);
                    
    GetResponse().AppendStringWithBreak("Thank you for your participation!");
                    
    GetResponse().AppendInt32(1);
                    
    GetResponse().AppendInt32(5383);
                    
    GetResponse().AppendInt32(1);
                    
    GetResponse().AppendInt32(1);
                    
    GetResponse().AppendStringWithBreak((string)Row["description"]);
                    
    GetResponse().AppendInt32(9);
                    
    GetResponse().AppendInt32(1);
                    
    GetResponse().AppendInt32(9);
                    
    GetResponse().AppendStringWithBreak((string)Row["question1"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question2"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question3"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question4"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question5"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question6"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question7"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question8"]);
                    
    GetResponse().AppendStringWithBreak((string)Row["question9"]);
                    
    SendResponse();
                }
            }

            public 
    void RoomPollVote()
            {
                
    int Answer int.Parse(Request.ToString().Substring(Request.ToString().Length 1));
                
    int PollId Request.PopWiredInt32();

                if (
    Answer != 0)
                {
                    
    using (DatabaseClient dbClient UberEnvironment.GetDatabase().GetClient())
                    {
                        
    dbClient.ExecuteQuery("UPDATE room_poll SET vote" Answer " = vote" Answer " + 1");
                    }
                }
            } 
    Search for:
    PHP Code:
    RequestHandlers[3000] = new RequestHandler(GetPetsInventory); 
    Add under it:
    PHP Code:
                RequestHandlers[234] = new RequestHandler(RoomPollSystem);
                
    RequestHandlers[236] = new RequestHandler(RoomPollVote); 
    Sql:
    PHP Code:
    -- --------------------------------------------------------

    --
    -- 
    Tabelstructuur voor tabel `room_poll`
    --

    CREATE TABLE IF NOT EXISTS `room_poll` (
      `
    idint(11NOT NULL AUTO_INCREMENT,
      `
    roomint(11NOT NULL,
      `
    messagetext NOT NULL,
      `
    questiontext NOT NULL,
      `
    descriptiontext NOT NULL,
      `
    question1varchar(255NOT NULL,
      `
    question2varchar(255NOT NULL,
      `
    question3varchar(255NOT NULL,
      `
    question4varchar(255NOT NULL,
      `
    question5varchar(255NOT NULL,
      `
    question6varchar(255NOT NULL,
      `
    question7varchar(255NOT NULL,
      `
    question8varchar(255NOT NULL,
      `
    question9varchar(255NOT NULL,
      `
    vote1int(11NOT NULL DEFAULT '0',
      `
    vote2int(11NOT NULL DEFAULT '0',
      `
    vote3int(11NOT NULL DEFAULT '0',
      `
    vote4int(11NOT NULL DEFAULT '0',
      `
    vote5int(11NOT NULL DEFAULT '0',
      `
    vote6int(11NOT NULL DEFAULT '0',
      `
    vote7int(11NOT NULL DEFAULT '0',
      `
    vote8int(11NOT NULL DEFAULT '0',
      `
    vote9int(11NOT NULL DEFAULT '0',
      
    PRIMARY KEY (`id`)
    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=;

    --
    -- 
    Gegevens worden uitgevoerd voor tabel `room_poll`
    --

    INSERT INTO `room_poll` (`id`, `room`, `message`, `question`, `description`, `question1`, `question2`, `question3`, `question4`, `question5`, `question6`, `question7`, `question8`, `question9`, `vote1`, `vote2`, `vote3`, `vote4`, `vote5`, `vote6`, `vote7`, `vote8`, `vote9`) VALUES
    (17'Click on OK :D''How cool is TopErwin?!''Just tell me!!! :D''HE''S AMAZING!''HE''S F*CKING AMAZING!''HE''S AMAZING LIKE SAUSAGE!''HE''S TOO AMAZING!''HE''S INCREDIBLE AMAZING!''HE''S 100% NICE!!''HE''S 100% COOL!! :D''HE''S 292% AMAZING! :D''poor -,-'010000010); 
    How to use?!:
    -> Look into your database for the id from the room where u wanted to start the poll,
    -> Add into the sql the row (DONT FILLIN THE 'vote' ROWS!)
    -> Go to the room where u have made the poll
    -> Use the command ":startpoll" (without the "")
    -> Won't work? -> check your sql!

    Screenshots:
    http://img209.imageshack.us/img209/4356/roompoll1.png
    http://img228.imageshack.us/img228/4927/roompoll2.png
    http://img560.imageshack.us/img560/6469/roompoll3.png
    http://img820.imageshack.us/img820/3144/roompoll4.png

    Credits:
    -> TopErwin (coding this stuff)
    -> =dj.matias= (logging the packets)
    -> Meth0d (making UberEmu)
    Last edited by toperwin; 05-02-11 at 09:24 PM.


  2. #2

    Re: [UberEmu] RoomPolls!!

    Thanks!

  3. #3
    swagggggg Livar is offline
    MemberRank
    Oct 2008 Join Date
    United KingdomLocation
    2,272Posts

    Re: [UberEmu] RoomPolls!!

    awesome.

  4. #4
    I use to love it more! Jmandupree is offline
    MemberRank
    Oct 2009 Join Date
    /ragezone/homeLocation
    996Posts

    Re: [UberEmu] RoomPolls!!

    Wow Thanks That was Fast!

  5. #5
    Banned PEjump2 is offline
    BannedRank
    Jan 2010 Join Date
    The NetherlandsLocation
    2,838Posts

    Re: [UberEmu] RoomPolls!!

    Abit bad coded, if there isn't a entry for the current room,
    and someone would trigger ":startpoll" in the current room,
    it would crash the emulator with a NullReferenceException.

  6. #6
    League of Legends <3 toperwin is offline
    MemberRank
    Jan 2009 Join Date
    313Posts

    Re: [UberEmu] RoomPolls!!

    Quote Originally Posted by PEjump2 View Post
    Abit bad coded, if there isn't a entry for the current room,
    and someone would trigger ":startpoll" in the current room,
    it would crash the emulator with a NullReferenceException.
    i don't have that problem bcouse i have a GOOD coded emulator,

    Btw, for the ppl with a "shitty" emulator i updated code ;)
    Now it needs to work i think,

    And btw, maybe this is "shitty" coded, but you even CAN'T code :D

  7. #7
    C# | C++ Emerica is offline
    MemberRank
    Oct 2010 Join Date
    GermanyLocation
    437Posts

    Re: [UberEmu] RoomPolls!!

    awesome release, thanks

  8. #8
    Banned PEjump2 is offline
    BannedRank
    Jan 2010 Join Date
    The NetherlandsLocation
    2,838Posts

    Re: [UberEmu] RoomPolls!!

    Quote Originally Posted by toperwin View Post
    i don't have that problem bcouse i have a GOOD coded emulator,

    Btw, for the ppl with a "shitty" emulator i updated code ;)
    Now it needs to work i think,

    And btw, maybe this is "shitty" coded, but you even CAN'T code :D
    "You even CAN'T code", Yeah, good english bro :3

  9. #9
    No, Just no. Matthew is offline
    MemberRank
    Jul 2008 Join Date
    United KingdomLocation
    1,408Posts

    Re: [UberEmu] RoomPolls!!

    Quote Originally Posted by toperwin View Post
    i don't have that problem bcouse i have a GOOD coded emulator,

    Btw, for the ppl with a "shitty" emulator i updated code ;)
    Now it needs to work i think,

    And btw, maybe this is "shitty" coded, but you even CAN'T code :D
    If there is an error there's an error. No exceptions. Even if which I doubt your so called 'emulator' is stable you would know that what PEJump said is slightly true. Also, you probably don't know what 'good' coded is. Just because your emulator doesn't crash for more than 12 hours and doesn't disconnect everyone it isn't "good". I bet it still floods your MySQL server with queries for everything :)

  10. #10
    sexiess is a sin. Subway is offline
    MemberRank
    Jun 2010 Join Date
    2,491Posts

    Re: [UberEmu] RoomPolls!!

    great release, keep it up (y)

  11. #11
    League of Legends <3 toperwin is offline
    MemberRank
    Jan 2009 Join Date
    313Posts

    Re: [UberEmu] RoomPolls!!

    Quote Originally Posted by Matthew View Post
    If there is an error there's an error. No exceptions. Even if which I doubt your so called 'emulator' is stable you would know that what PEJump said is slightly true. Also, you probably don't know what 'good' coded is. Just because your emulator doesn't crash for more than 12 hours and doesn't disconnect everyone it isn't "good". I bet it still floods your MySQL server with queries for everything :)
    true, true, true, all true ;)
    but i just have pejump and wanted to not concur him. (when we talk about uberemu,)
    and it's a new code, ofcourse this isnt perfect but it's a begin,
    and i'm just young coding skid, real coders will NEVER start with a "habbo retro" i guess ;)
    Last edited by toperwin; 06-02-11 at 08:53 AM.

  12. #12
    Enthusiast Inesperto is offline
    MemberRank
    Jun 2010 Join Date
    32Posts

    Re: [UberEmu] RoomPolls!!

    This is so cool!
    Fantastic! Thanks!!!

  13. #13
    Member efferinie is offline
    MemberRank
    Aug 2008 Join Date
    69Posts

    Re: [UberEmu] RoomPolls!!

    Good Release TopErwin!

  14. #14
    Proficient Member superdaan44 is offline
    MemberRank
    Jan 2009 Join Date
    in a chest.Location
    182Posts

    Re: [UberEmu] RoomPolls!!

    Awesome release toperwin , I really hope to see more of your work

    PEjump2 I'm really tired of you bad comments to each topic of him.
    Code it by yourself and release it and let us take really compare if you can actually code better more than Toperwin, giving bad comments is the best thing you can now, but show us the real work. ;)

  15. #15
    Account Upgraded | Title Enabled! Chapo is offline
    MemberRank
    Jul 2010 Join Date
    United StatesLocation
    944Posts

    Re: [UberEmu] RoomPolls!!

    OMG! Awesome! I like it :)

    I'm using it ^^.



Advertisement