[RELEASE][PlusEMU] Smokeweed command

Results 1 to 16 of 16
  1. #1
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    [RELEASE][PlusEMU] Smokeweed command

    Requirements: Visual Studio.


    Hello you all! I'm writing this tutorial because I saw that on another forum alot of people wanted to use a smokeweed commands that someone posted. Though it wasn't properly done, because it used thread.sleep to create a timer, which isn't the right way. I read on some post by Spotify where he said that tasks should be used instead so I started reading up on it. I came up with this result. If I'm doing it the wrong way, then I'm open to constructive criticism. Don't hate please :)
    Let's get right into it shall we?



    To start with open up "Plus Emulator.sln" located in the root of the emulator. Aka when you firstly open up the folder.


    First off you want to head over to CommandManager.cs located in, HabboHotel/Rooms/Chat/Commands/CommandManager.cs,
    Look for this:
    Code:
            private void RegisterUser()
            {

    Under that add this:
    Code:
    this.Register("smokeweed", new SmokeWeedCommand());

    http://i.imgur.com/HoZ9Bqo.png


    Now you're done with this part. Head over to HabboHotel/Rooms/Chat/Commands/User and create a new .cs file. If you're using Visual Studio right click on the folder and hover Add then create a new Class. Name it "SmokeWeedCommand.cs".
    http://i.imgur.com/2eQTmOv.png

    Just replace everything with this:


    Code:
    using System;
    Code:
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Plus.HabboHotel.GameClients;
    using Plus.Communication.Packets.Outgoing.Rooms.Chat;
    
    
    namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun
    {
        class SmokeWeedCommand : IChatCommand
        {
            public string PermissionRequired
            {
                get { return "command_smokeweed"; }
    
    
            }
    
    
            public string Parameters
            {
                get { return ""; }
    
    
            }
    
    
            public string Description
            {
                get { return "Get as stoned as Snoop Dog"; }
            }
    
    
            public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
            {
                RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                if (ThisUser == null)
                    return;
    
    
                Task.Run(async delegate
                {
                    Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*" + Session.GetHabbo().Username + ", rolls a spliff*", 0, ThisUser.LastBubble));
                    await Task.Delay(1000);
                    Session.GetHabbo().Effects().ApplyEffect(26);
                    Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*" + Session.GetHabbo().Username + ", Lights up the joint*", 0, ThisUser.LastBubble));
                    await Task.Delay(500);
                    Session.GetHabbo().Effects().ApplyEffect(0);
                    await Task.Delay(1000);
                    Session.GetHabbo().Effects().ApplyEffect(53);
                    Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*" + Session.GetHabbo().Username + ", Smokes the beautiful joint*", 0, ThisUser.LastBubble));
                    await Task.Delay(5000);
                    Session.GetHabbo().Effects().ApplyEffect(0);
                });
            }
        }
    }

    Now all that's left is to headover to the database and choose permission_commands. There you make a new field and name it "command_smokeweed". You set group_id to 0 and subscription_id to 0.
    http://i.imgur.com/6KN49Q1.png
    If you did all of that then you shouldn't have any problems and the command should work just fine.



  2. #2
    Apprentice JackHazard69 is offline
    MemberRank
    Apr 2014 Join Date
    17Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    How do you debug

  3. #3
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by JackHazard69 View Post
    How do you debug
    Do you have visual studio?

    Skickat från min FRD-L09 via Tapatalk

  4. #4
    Member Sonay is offline
    MemberRank
    Feb 2016 Join Date
    GermanyLocation
    93Posts

    Re: [RELEASE][PlusEMU] Smokeweed command


  5. #5
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Please read both commands and tell me if it's a re-release or no... he used thread.sleep and i use tasks. Good luck using commands after the thread has slept. So no this isn't a re-release, this is a more proper release :)

    Skickat från min FRD-L09 via Tapatalk

  6. #6
    Retired maritnmine is offline
    MemberRank
    May 2007 Join Date
    North KoreaLocation
    1,103Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by JackHazard69 View Post
    How do you debug
    Nobody really knows the answer to your question. You may seek advice from our great overl0rd @saamus on how to do this.

  7. #7
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by maritnmine View Post
    Nobody really knows the answer to your question. You may seek advice from our great overl0rd @saamus on how to do this.
    He didn't open the .sln ... that's why he couldn't debug, he only opened the .cs files themselves. Solved it for him though :)

    Skickat från min FRD-L09 via Tapatalk

  8. #8
    topkek amirite?? Leon is offline
    MemberRank
    May 2009 Join Date
    919Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by maritnmine View Post
    Nobody really knows the answer to your question. You may seek advice from our great overl0rd @saamus on how to do this.
    praise overl0rd saamus, almighty PhP godfather.

    edit: 9/11 posts.. marit did 9/11 confirmed

  9. #9
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by Leon View Post
    praise overl0rd saamus, almighty PhP godfather.

    edit: 9/11 posts.. marit did 9/11 confirmed
    Leon is back on track?

  10. #10
    Apprentice Roas is offline
    MemberRank
    Jan 2017 Join Date
    24Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    AHAHAHAH , Is my command , need you write [FIX]SmokeWeed , but don't [RELEASE]
    PFF

  11. #11
    Enthusiast u20 is offline
    MemberRank
    Sep 2016 Join Date
    26Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    @Roas are you serious? Please, shut up and learn something.

    How can you understand c# if you don't know PHP? Or HTML? Or CSS?

  12. #12
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by u20 View Post
    @Roas are you serious? Please, shut up and learn something.

    How can you understand c# if you don't know PHP? Or HTML? Or CSS?
    Let him feel proud lol :)

    Skickat från min FRD-L09 via Tapatalk

  13. #13
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by Roas View Post
    AHAHAHAH , Is my command , need you write [FIX]SmokeWeed , but don't [RELEASE]
    PFF
    Instead of becoming mad, see this as a lesson, on how to make delays properly :) And it's not like your command, just the name is :)

    Skickat från min FRD-L09 via Tapatalk

  14. #14
    git bisect -m ovflowd is offline
    MemberRank
    Sep 2011 Join Date
    2,191Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by Leon View Post
    praise overl0rd saamus, almighty PhP godfather.

    edit: 9/11 posts.. marit did 9/11 confirmed
    lolwut.

    I'm not overlord hahahaha i'm sucklord.

  15. #15
    The **** Keiz is offline
    MemberRank
    Nov 2015 Join Date
    238Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Yet another useless command, but at least it's asynchronous!
    I believe some can learn from it

    EDIT:
    Btw for local variables do use lowerCamelCase!

  16. #16
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [RELEASE][PlusEMU] Smokeweed command

    Quote Originally Posted by Keiz View Post
    Yet another useless command, but at least it's asynchronous!
    I believe some can learn from it

    EDIT:
    Btw for local variables do use lowerCamelCase!
    The release of this command wasn't to make a cool command, it was to get people to use asynchronous code when making delays, etc. :)

    Skickat från min FRD-L09 via Tapatalk



Advertisement