Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Web [Tut] How to make GM List ingame

Status
Not open for further replies.
Super-Moderator
Staff member
Super-Moderator
Joined
Apr 28, 2007
Messages
1,501
Reaction score
759
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:
[SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] NPCsScripts::npc_9010009(NPC* npc){
[/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] state = npc->getState();
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 0){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"Hello, I am Duey. I can tell you who the GM's are. I allways follow them, so I collected some information"[/COLOR][/SIZE][SIZE=2]);
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]" Click on the names for information about them."[/COLOR][/SIZE][SIZE=2]);
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L0#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L1#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L2#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L3#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L4#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L5#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ 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([SIZE=2][COLOR=#a31515]"\r\n#L6#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here[/SIZE]
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:
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 1){
type = npc->getSelected();
npc->setVariable([/SIZE][SIZE=2][COLOR=#a31515]"type"[/COLOR][/SIZE][SIZE=2], type);
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 0){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE  "[/COLOR][/SIZE][SIZE=2]); \\ This is L0 ( Line 0 )[/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#000000][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 1){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]);  \\ This is L1
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 2){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L2
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 3){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L3[/SIZE][SIZE=2]
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 4){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE"[/COLOR][/SIZE][SIZE=2]); \\ This is L4
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L5
npc->sendOK();
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 2){
npc->end();
}
}

So the code will look like this now :

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

npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE  "[/COLOR][/SIZE][SIZE=2]); \\ This is L0 ( Line 0 )[/SIZE] [SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#000000][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
npc->sendOK();

}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 1){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]);  \\ This is L1
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 2){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L2
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 3){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L3[/SIZE][SIZE=2]
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 4){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE"[/COLOR][/SIZE][SIZE=2]); \\ This is L4
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L5
npc->sendOK();
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 2){
npc->end();
}
}

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

Now change
Code:
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L5
npc->sendOK();
}
}
To
Code:
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ 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:
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 6){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L6
npc->sendOK();
}
}
Put that below the Line 5, above the code
Code:
[SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 2){
npc->end();
}
}
[/SIZE]

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 ) )

[/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE]
 
Last edited:
Newbie Spellweaver
Joined
Apr 27, 2008
Messages
12
Reaction score
0
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
 
Newbie Spellweaver
Joined
May 14, 2008
Messages
7
Reaction score
0
Re: [GUIDE] How to make GM List ingame

lol. i cant find TeleportNPCs.cpp. where should i look?
 
Mother effin' clouds
Loyal Member
Joined
Apr 13, 2008
Messages
1,534
Reaction score
448
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
 
Initiate Mage
Joined
May 2, 2008
Messages
1
Reaction score
0
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:
#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?)
 
Super-Moderator
Staff member
Super-Moderator
Joined
Apr 28, 2007
Messages
1,501
Reaction score
759
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

It is possible to make it as a command, but not sure if you can click on "Information" of the person.
 
Super-Moderator
Staff member
Super-Moderator
Joined
Apr 28, 2007
Messages
1,501
Reaction score
759
Re: [GUIDE] How to make GM List ingame

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:
[SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515]"NPCs.h"
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515]"Player.h"
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515]"NPCsScripts.h"
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515]"Inventory.h"
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515]"Mobs.h"
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515]"Players.h"
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515]"PlayersPacket.h"[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515][/COLOR][/SIZE] 
[SIZE=2][COLOR=#a31515] 
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] type;
[/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] ticket;[/SIZE]
[SIZE=2]
[/SIZE]

Like Alexander_Drake said.
 
Newbie Spellweaver
Joined
May 14, 2008
Messages
7
Reaction score
0
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.
 
Super-Moderator
Staff member
Super-Moderator
Joined
Apr 28, 2007
Messages
1,501
Reaction score
759
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.
 
Super-Moderator
Staff member
Super-Moderator
Joined
Apr 28, 2007
Messages
1,501
Reaction score
759
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
 
Newbie Spellweaver
Joined
Jun 3, 2008
Messages
84
Reaction score
13
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
 
Experienced Elementalist
Loyal Member
Joined
Dec 15, 2007
Messages
241
Reaction score
1
Re: [Guide] How to make GM List ingame

Thanks Biesmen, this helped me. xD
 
Skilled Illusionist
Loyal Member
Joined
Jun 23, 2008
Messages
324
Reaction score
0
Re: [Guide] How to make GM List ingame

oh well nice release, anyway i saw some servers has a NPC for Gm list long time ago
 
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
hey, can u help me?
when i start my server at the top it says, something like: welcome to put YOURSNAME here using biesmens repack.

how do i change that into my servers name??

(and thank for the gm thing it really works good:)::thumbup:
 
Newbie Spellweaver
Joined
Apr 5, 2009
Messages
69
Reaction score
0
Biesnis - [Tut] How to make GM List ingame - RaGEZONE Forums


i get stuck at the character screen still
i've done everything correctly, from mysql to wz files
help please !
 
Status
Not open for further replies.
Back
Top