[Tut] How to make GM List ingame

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    [Tut] How to make GM List ingame

    Hello.
    I made this guide because.. I want to make a guide, lol...

    I think this works for all server sources. ( Especially Kryt's )

    Ok, we're going to take Duey the packakge deliverer. ( You can allways change if you want )

    Open TeleportNPCs.cpp ( I made it there, not sure if it will work if you make a own .cpp )

    Go down, and put this code :

    Code:
    void NPCsScripts::npc_9010009(NPC* npc){
    int state = npc->getState();
    if(state == 0){
    npc->addText("Hello, I am Duey. I can tell you who the GM's are. I allways follow them, so I collected some information");
    npc->addText(" Click on the names for information about them.");
    npc->addText("\r\n#L0#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L1#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L2#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L3#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L4#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L5#NAME#l"); \\ Add GM name here
    npc->sendSimple();
    }
    


    If you want more GM names, then add the code ( above npc->sendSimple(); )

    Then add this :
    Code:
    npc->addText("\r\n#L6#NAME#l"); \\ Add GM name here
    The code before was with L5 instead of L6, if you want more then add a new text again, and call it L7, L8, L9, etc.

    Ok now we're done with that

    then add below
    Code:
    elseif(state == 1){
    type = npc->getSelected();
    npc->setVariable("type", type);
    if(type == 0){
    npc->addText("GM INFORMATION HERE  "); \\ This is L0 ( Line 0 )
    npc->sendOK();
    }
    if(type == 1){
    npc->addText("GM INFORMATION HERE ");  \\ This is L1
    npc->sendOK();
    }
    if(type == 2){
    npc->addText("GM INFORMATION HERE "); \\ This is L2
    npc->sendOK();
    }
    if(type == 3){
    npc->addText("GM INFORMATION HERE "); \\ This is L3
    npc->sendOK();
    }
    if(type == 4){
    npc->addText("GM INFORMATION HERE"); \\ This is L4
    npc->sendOK();
    }
    if(type == 5){
    npc->addText("GM INFORMATION HERE "); \\ This is L5
    npc->sendOK();
    }
    }
    elseif(state == 2){
    npc->end();
    }
    }
    


    So the code will look like this now :

    Code:
    void NPCsScripts::npc_9010009(NPC* npc){
    int state = npc->getState();
    if(state == 0){
    npc->addText("Hello, I am Duey. I can tell you who the GM's are. I allways follow them, so I collected some information");
    npc->addText(" Click on the names for information about them.");
    npc->addText("\r\n#L0#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L1#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L2#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L3#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L4#NAME#l"); \\ Add GM name here
    npc->addText("\r\n#L5#NAME#l"); \\ Add GM name here
    npc->sendSimple();
    }
    elseif(state == 1){
    type = npc->getSelected();
    npc->setVariable("type", type);
    if(type == 0){
    
    npc->addText("GM INFORMATION HERE  "); \\ This is L0 ( Line 0 ) 
    npc->sendOK();
    
    }
    if(type == 1){
    npc->addText("GM INFORMATION HERE ");  \\ This is L1
    npc->sendOK();
    }
    if(type == 2){
    npc->addText("GM INFORMATION HERE "); \\ This is L2
    npc->sendOK();
    }
    if(type == 3){
    npc->addText("GM INFORMATION HERE "); \\ This is L3
    npc->sendOK();
    }
    if(type == 4){
    npc->addText("GM INFORMATION HERE"); \\ This is L4
    npc->sendOK();
    }
    if(type == 5){
    npc->addText("GM INFORMATION HERE "); \\ This is L5
    npc->sendOK();
    }
    }
    elseif(state == 2){
    npc->end();
    }
    }
    


    If you want more GM information ( If you added more GM's )

    Now change
    Code:
    if(type == 5){
    npc->addText("GM INFORMATION HERE "); \\ This is L5
    npc->sendOK();
    }
    }
    

    To
    Code:
    if(type == 5){
    npc->addText("GM INFORMATION HERE "); \\ This is L5
    npc->sendOK();
    }
    


    And add code ( this is the last one, I mean the last line, you can add more but then you need to do
    Code:
    }
    Instead of
    Code:
    }
    }
    For line 6 put this code

    Code:
    if(type == 6){
    npc->addText("GM INFORMATION HERE "); \\ This is L6
    npc->sendOK();
    }
    }
     
    

    Put that below the Line 5, above the code
    Code:
    elseif(state == 2){
    npc->end();
    }
    }
    
    Now open NPCsScripts.h
    And find this code :

    Code:
    case 9200000: npc_9200000(npc); break;
    But below that code :

    Code:
    case 9010009: npc_9010009(npc); break;
    Now search for :
    Code:
    static void npc_9200000(NPC* npc)
    But below that code :
    Code:
    static void npc_9010009(NPC* npc);
    To change of NPC, then just change the npc_9010009 to a another ID ( npc_npcid ) at the Duey code, and the static void, and break




    Need help? Just reply.

    Credits :
    Carter ( Biesmen ( me ) )

    Last edited by Biesmen; 17-05-08 at 10:25 AM. Reason: Something wasn't right xD


  2. #2
    Enthusiast jampa_g is offline
    MemberRank
    Apr 2008 Join Date
    46Posts

    Re: [GUIDE] How to make GM List ingame

    ooo nice but i don't got gm's atm so i will try it on miself xD

  3. #3
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    Re: [GUIDE] How to make GM List ingame

    Lol, okay, if you need help ask me..

  4. #4
    Apprentice Thijme94 is offline
    MemberRank
    May 2008 Join Date
    15Posts

    Re: [GUIDE] How to make GM List ingame

    lol. i cant find TeleportNPCs.cpp. where should i look?

  5. #5
    Mother effin' clouds SaintsIan is offline
    MemberRank
    Apr 2008 Join Date
    fyrechat.netLocation
    2,809Posts

    Re: [GUIDE] How to make GM List ingame

    hey just to add to this. Is it possible for you to make it as a command? i'm going to try to do that though. Nice one, my duey is a star recharger xD

  6. #6

    Re: [GUIDE] How to make GM List ingame

    @ Thijme94: He is under the impression that you have already fixed your teleporter NPCs such as the regular cab using ToxicWinds coding, so if you haven't done that (or set up say Cody as your teleporter) then you need this

    PHP Code:
    #include "NPCs.h"
    #include "Player.h"
    #include "NPCsScripts.h"
    #include "Inventory.h"


    int type;
    int ticket
    before all of that and have it added to your project. However if you do this you'll have to put your teleporter in the document you just created.

    (If this doesn't help you, let me know okay?)

  7. #7
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    Re: [GUIDE] How to make GM List ingame

    Quote Originally Posted by SaintsIan View Post
    hey just to add to this. Is it possible for you to make it as a command? i'm going to try to do that though. Nice one, my duey is a star recharger xD
    It is possible to make it as a command, but not sure if you can click on "Information" of the person.

  8. #8
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    Re: [GUIDE] How to make GM List ingame

    Quote Originally Posted by Thijme94 View Post
    lol. i cant find TeleportNPCs.cpp. where should i look?
    You can try to make a own .cpp

    Then put that codes, and at top :

    Code:
    #include"NPCs.h"
    #include"Player.h"
    #include"NPCsScripts.h"
    #include"Inventory.h"
    #include"Mobs.h"
    #include"Players.h"
    #include"PlayersPacket.h"
     
     
    int type;
    int ticket;


    Like Alexander_Drake said.

  9. #9
    Apprentice Thijme94 is offline
    MemberRank
    May 2008 Join Date
    15Posts

    Re: [GUIDE] How to make GM List ingame

    ok ty

  10. #10
    Apprentice Thijme94 is offline
    MemberRank
    May 2008 Join Date
    15Posts

    Re: [GUIDE] How to make GM List ingame

    oops, got other problem. (srry im noob at coding.) if i do CTRL+F In NPCsScripts.H, and search for 'case 9200000: npc_9200000(npc); break;' he cant find that line.

  11. #11
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    Re: [GUIDE] How to make GM List ingame

    Then search for the line :
    Code:
    case 9201023: npc_9201023(npc); break;
    And put the NPC you're adding below that line, and for the static void search for :
    Code:
    static void npc_9201023(NPC* npc);
    And put that static void code of the NPC that you're adding below that line.

  12. #12
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    Re: [Guide] How to make GM List ingame

    Sorry for double post..

    You see "elseif" if it isn't blue, you need to make it "else if"

    P.S.. I posted this exaclty 1 month later than my last reply here, so you won't think I replyed, and 2 sec later I replyed again

  13. #13
    :) RpViet is offline
    MemberRank
    Jun 2008 Join Date
    356Posts

    Re: [Guide] How to make GM List ingame

    It'd be much more easier if you were to fetch the info from the mysql and make it so it only gets it where GM = 1

  14. #14
    Account Upgraded | Title Enabled! New User is offline
    MemberRank
    Dec 2007 Join Date
    CanadaLocation
    1,001Posts

    Re: [Guide] How to make GM List ingame

    Thanks Biesmen, this helped me. xD

  15. #15
    Omega ihatehaxor is offline
    MemberRank
    Apr 2008 Join Date
    JerseyLocation
    5,461Posts

    Re: [Guide] How to make GM List ingame

    this is for cpp



Page 1 of 2 12 LastLast

Advertisement