Creating Custom Commands menu

User Tag List

Results 1 to 10 of 10
  1. #1
    sebbe00's Avatar Member
    Reputation
    9
    Join Date
    Nov 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating Custom Commands

    Maybe you want to make custom commands sometime for your server. Look here and learn:


    void onCommand(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
    if(Message == "#command") //If player message is #command do followning
    {
    pPlayer->EventTeleport(MAPID, X, Y, Z);
    }
    }
    void SetupCommand(ScriptMgr * Mgr)
    {
    mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &onCommand); //Register the command
    }


    Here is the Explanation: (sorry, couldn't write it before, hadn't the time)

    This is for the first a C++ script, just compile it to make it work.

    void onCommand(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)

    this line over here, You declare the void OnCommand, so you can call this function later in any other function. This line is much more interesting:

    if(Message == "#command")

    so If player Message is (==) #command, then we do followning between these two { }

    so it should look like this by now

    void onCommand(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
    if(Message == "#command")
    {

    Here we can code anything you want the player to do when entering the command. In this case we use an Teleport Event.

    pPlayer->EventTeleport(MAPID, X, Y, Z);

    MapID = The mapid of the map.
    X = the X location.
    Y = the Y location.
    Z = the Z location.

    just type .gps
    ingame to get these Coordinates at the spot your standing.

    So this far we have declared an function, and if the player says: #command, you get teleported to your location.

    But it ain't far from done yet, so we end the IF section with this character:

    }

    The script should look like this now :

    void onCommand(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
    if(Message == "#command")
    {
    pPlayer->EventTeleport(MAPID, X, Y, Z);
    }


    but now we have to finish the Function by another { letter:

    void onCommand(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
    if(Message == "#command")
    {
    pPlayer->EventTeleport(MAPID, X, Y, Z);
    }
    }

    So now we just did a simple function. Now we only have to Register the function so it works ingame, we do that by another function:

    void SetupCommand(ScriptMgr * Mgr)
    {



    The server call this function inside the DLL, just to register the #command event.

    Now we have to register the command event. Do that by typing this in the SetupCommand function:

    mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &onCommand);

    Note the white text, this text right here calls our earlier function OnCommand, just by placing character & in front of it.

    Now we have done the command event, and soon the SetupCommand event, just by finishing it with this character }

    }

    Now it should look like this :

    void onCommand(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
    if(Message == "#command")
    {
    pPlayer->EventTeleport(MAPID, X, Y, Z);
    }
    }
    void SetupCommand(ScriptMgr * Mgr)
    {
    mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &onCommand);
    }


    We have just written an .cpp script, hurray!
    You just have to compile it to get it ingame. It is a bunch of compiler guides here at mmowned. Here is one of them:

    http://www.mmowned.com/forums/emulat...r-own-dll.html
    Last edited by sebbe00; 12-13-2008 at 03:15 AM.

    Creating Custom Commands
  2. #2
    Synris's Avatar Active Member
    Reputation
    70
    Join Date
    Mar 2008
    Posts
    281
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dont ask for rep.

    and please go into detail because i dont know wtf im looking at here.

  3. #3
    Confucius's Avatar Panda of Worlds The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1389
    Join Date
    Oct 2007
    Posts
    2,590
    Thanks G/R
    267/283
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ...This is what the post looked like to me
    Wanted to make custom commands? Look and learn:
    frasjlfjsdlkjf;ksdjlksdaflks;jfklsdjfiosejfioewjf;awjf
    ewfwsfiojefoiajsfiojweoiafioewji;oew
    fewaifjaowe
    Now give me rep
    could you explain more?

  4. #4
    colincancer's Avatar Active Member
    Reputation
    63
    Join Date
    Dec 2007
    Posts
    509
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wtf is this shit....
    #JODYS'WATCHiN

  5. #5
    Tornad0z's Avatar Member
    Reputation
    7
    Join Date
    Aug 2007
    Posts
    154
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude, please explain a little better for us?

  6. #6
    sebbe00's Avatar Member
    Reputation
    9
    Join Date
    Nov 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now i've explained it, sorry. Hadn't the time to do it when i posted

  7. #7
    ~Jagris's Avatar Contributor
    Reputation
    154
    Join Date
    Apr 2007
    Posts
    1,479
    Thanks G/R
    2/2
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I saw it pretty clearly, nice post.


  8. #8
    Padlockcode's Avatar Active Member
    Reputation
    44
    Join Date
    Dec 2006
    Posts
    116
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude dont let those people let you down they just dont know anything about C++

    Lol Good guide ! +rep

  9. #9
    blind999's Avatar Member
    Reputation
    4
    Join Date
    Jan 2008
    Posts
    46
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You guys this isnt that difficult.. its easy to understand if you have a little programming experiance, go check the Programming section

    +rep

  10. #10
    mode's Avatar Member
    Reputation
    1
    Join Date
    Mar 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very nice helped alot ty:P

Similar Threads

  1. [Question] Creating Custom Commands
    By Edge94 in forum WoW EMU Questions & Requests
    Replies: 9
    Last Post: 01-03-2009, 04:50 AM
  2. create custom commands
    By wowsc4p3 in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 04-23-2008, 06:59 AM
  3. How to create custom monsters for your server!
    By renitharis in forum WoW EMU Guides & Tutorials
    Replies: 13
    Last Post: 12-10-2007, 07:53 PM
All times are GMT -5. The time now is 08:20 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search