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!

Simple !showshop command

Junior Spellweaver
Joined
Apr 11, 2008
Messages
108
Reaction score
0
I know this is a very basic code, but I haven't seen it on here so I decided to post it. Sorry if it has been posted before.

Code:
        else if(strcmp(command, "showshop") == 0){
        Shops::showShop(player, atoi(strtok_s(NULL, " ",&next_token)));
        }

It basically explains itself. Enter !showshop and then the shop ID you want. I find it easier to do this to test a lot of shops you added rather than creating a new ! command for each.

Oh and if you still use xml files for your server, you will most likely have to replace 'atoi' with 'strval' in the code.
 
Junior Spellweaver
Joined
Oct 10, 2007
Messages
101
Reaction score
0
Re: [Release] Simple !showshop command

awesome i hated making so many commands for shops.
 
Newbie Spellweaver
Joined
Jan 17, 2008
Messages
66
Reaction score
6
Re: [Release] Simple !showshop command

Might want to add some error-handlers like
if (strlen(next_token) > 0){
}
 
Junior Spellweaver
Joined
Apr 13, 2008
Messages
113
Reaction score
0
Re: [Release] Simple !showshop command

Ah.

The GM Handbook doesnt have shop ID's in it

Damnit >_>
 
Job Accomplished!
Joined
Jul 7, 2006
Messages
294
Reaction score
0
Re: [Release] Simple !showshop command

SO...

It should be like:

Code:
		else if(strcmp(command, "showshop") == 0){
			if(strlen(next_token) > 0) {
			Shops::showShop(player, strval(strtok_s(NULL, " ",&next_token)));
        }
		}

Just a copy paste for some members.
 
Junior Spellweaver
Joined
Apr 11, 2008
Messages
108
Reaction score
0
Re: [Release] Simple !showshop command

Yea sorry forgot "if(strlen(next_token) > 0) {" I usually dont use that but it does help.
 
Newbie Spellweaver
Joined
Sep 26, 2008
Messages
6
Reaction score
0
Re: [Release] Simple !showshop command

do we put this in commandprocessor?
 
Junior Spellweaver
Joined
Apr 20, 2008
Messages
123
Reaction score
0
Re: [Release] Simple !showshop command

do we put this in commandprocessor?

/laugh.

@squishy: I do believe shopids are in your database, they're not "set". So, you can edit it in your database all you want.

Whoa. Just noticed the date o_o.
 
Last edited:
Newbie Spellweaver
Joined
Aug 7, 2008
Messages
31
Reaction score
0
Re: [Release] Simple !showshop command

ban that guy for necroing a dead thread...
 
Back
Top