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!

Making none GM commands

Status
Not open for further replies.
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
I searched the forum but couldn't this way to make none gm commands.

I was looking on this forum on how to make none gm commands and find diffrent ways but i couldn't figure them out so I decided to find my own way.

After 5minutes or so I saw how and I think people should use their brains -_-

All credits for the none GM commands go to me because i diddn't use any help or tut.
But most of the credits (99%) for the nx shops goes to: http://forum.ragezone.com/showthread.php?t=397366/
for making the shops, and a little to me for making the commands.
And most of the credits (99%) for the scrollshop goes to: http://forum.ragezone.com/showthread.php?t=392773/
I made the maple shop myself.

1. Go to your chathandler and you should see something like this:
Code:
void Players::chatHandler(Player* player, unsigned char* packet){
	char chat[91];
	int chatsize = getShort(packet);
	getString(packet+2, chatsize, chat);
	if(chat[0] == ';' || chat[0] == '/'){
		if(!player->isGM()) return;
		char* next_token;
		char command[90] = "";
		if(chatsize>2)
			strcpy_s(command, 90, strtok_s(chat+1, " ", &next_token));

Replace with:
Code:
void Players::chatHandler(Player* player, unsigned char* packet){
	char chat[91];
	int chatsize = getShort(packet);
	getString(packet+2, chatsize, chat);
	if(chat[0] == '!'){
		char* next_token;
		char command[90] = "";
		if(chatsize>2)
			strcpy_s(command, 90, strtok_s(chat+1, " ", &next_token));
//none GM commands bellow, the first command must be an "if" statement
 		if(strcmp(command, "nxbottom") == 0){
			Shops::showShop(player, 9040001);
		}
		else if(strcmp(command, "nxglove") == 0){
			Shops::showShop(player, 9040002);
		}
		else if(strcmp(command, "nxshield") == 0){
			Shops::showShop(player, 9100002);
		}
		else if(strcmp(command, "nxshoe") == 0){
			Shops::showShop(player, 9100003);
		}
		else if(strcmp(command, "nxtop") == 0){
			Shops::showShop(player, 9100004);
		}
		else if(strcmp(command, "nxring") == 0){
			Shops::showShop(player, 9300001);
		}
		else if(strcmp(command, "nxhat1") == 0){
			Shops::showShop(player, 9300002);
		}
		else if(strcmp(command, "nxhat2") == 0){
			Shops::showShop(player, 9300003);
		}
		else if(strcmp(command, "nxemote") == 0 || strcmp(command, "nxeffect") == 0){
			Shops::showShop(player, 9300004);
		}
		else if(strcmp(command, "nxoverall") == 0){
			Shops::showShop(player, 9300005);
		}
		else if(strcmp(command, "nxweapon") == 0){
			Shops::showShop(player, 9300006);
		}
		else if(strcmp(command, "nxearring") == 0){
			Shops::showShop(player, 9300007);
		}
		else if(strcmp(command, "nxcoupon") == 0){
			Shops::showShop(player, 9300008);
		}
		else if(strcmp(command, "nxeye") == 0){
			Shops::showShop(player, 9300009);
		}
		else if(strcmp(command, "nxcape") == 0){
			Shops::showShop(player, 9310008);
		}
		else if(strcmp(command, "mapleshop") == 0){
			Shops::showShop(player, 100);
		}
		else if(strcmp(command, "scrollshop") == 0){
			Shops::showShop(player, 1052012);
		}
                else if(strcmp(command, "help") == 0){
		   char text[999];
                sprintf_s(text, 999, "%s need help from a GM",player->getName() );
                PlayersPacket::showMassage(text, 0);
                player->getName());
                }
                else if(strcmp(command, "save") == 0) {
		player->save();
                PlayersPacket::showMassage("You have saved your progress successfully", 5);
		}
//none GM commands above, the first command must be an "if" statement
	if(!player->isGM()) return;
//GM command bellow, if you used none GM commands all commands must be an "else if" statement,
//otherwise if you diddn't use none GM commands the first command must be an "if" statement

Thats all, well as you'll see I already putted some commands you can just remove them or let them there, I attached a zip file with the files for the commands.
Just put the files in the Shops folder (if it overwrites something you probally already have the cash shops from "Serushi" or the scrollshop from "NorthArmy" or you made a shop yourself named "100" from me).
If it overwrites shop "100" you can just let it there and the command "mapleshop" opens the shop you made, but if you overwrite it it opens a shop with all lvl64 maple items and maple umbrella.

Commands:
Code:
nxglove
nxshield
nxshoe
nxtop
nxring
nxhat1
nxhat2
nxemote, nxeffect //these two commands open same shop//
nxoverall
nxweapon
nxearring
nxcoupon
nxeye
nxcape
mapleshop
scrollshop

I think the commands speak for themselves. And otherwise just try them xD




[TUT]How to change the prices of the items in the shops.

Credits got to me.

If you wan't to change the itemprices go to the map "shops".
Then right click and select "edit" or "open with" and then the program you wan't to use.

Then you see all the items sold in the shop. just change the amount of mesos between "<price>" and "</price>"

Example: if you want to change the price of a muple umbrella from 25m to 50m go to shop 100 and change:
Code:
	        <Item>
			<ID>1302058</ID> //maple umbrella
			<price>25000000</price>
		</Item>

to:
Code:
	        <Item>
			<ID>1302058</ID> //maple umbrella
			<price>50000000</price>
		</Item>

Then quit and save and you changed the price.

Mind to rebuild if you changed anything to Players.cpp
If you changed some shop prices just restart

Don't mind my english xD and if I told something wrong just tell me ill edit it.

Hope you guys like it.

[EDIT]
I forgot to add maple shop, now added.

[EDIT]
I added !save command as someone requested I also added !help command so if a player uses "!help" it shows the notice "... need help from a GM". I diddn't had time to test them yet so if someone else could ill appriciate it.

Replace:
Code:
#include "Players.h"
#include "Player.h"
#include "PlayersPacket.h"
#include "Maps.h" 
#include "Mobs.h"
#include "Shops.h"
#include "Inventory.h"
#include "Drops.h"
#include "Levels.h"
#include "Server.h"

With:
Code:
#include "Players.h"
#include "Player.h"
#include "PlayersPacket.h"
#include "Maps.h"
#include "Mobs.h"
#include "Shops.h"
#include "Inventory.h"
#include "Drops.h"
#include "Levels.h"
#include "Server.h"
#include "Skills.h"
#include "SkillsPacket.h"
#include "PacketCreator.h"
#include <fstream> 
#include <iostream>
#include "LevelsPacket.h"
#include "MySQLM.h"
 

Attachments

You must be registered for see attachments list
Last edited:
Skilled Illusionist
Joined
Apr 6, 2008
Messages
389
Reaction score
1
Re: [release]Making none GM commands

Lol, way to go, genius. You completely took out GM commands.
 
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
Re: [release]Making none GM commands

Lol I diddn't, I tested and it worked.
Maybe you did something wrong and are flaming me for it.
 
Junior Spellweaver
Joined
Apr 15, 2007
Messages
154
Reaction score
0
Re: [release]Making none GM commands

you didnt do poop but remove the gm part o-o wow give yourself a pat on the back you did something my 6 year old sister could go -.-
 
Initiate Mage
Joined
May 4, 2008
Messages
3
Reaction score
0
Re: [release]Making none GM commands

that's supposed to work, gj for the release
 
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
Re: [release]Making none GM commands

No i just posted the start of the chathandler and some none GM commands.
If you also overwrited you GM commands then you diddn't read it right.
 
Initiate Mage
Joined
May 4, 2008
Messages
3
Reaction score
0
Re: [release]Making none GM commands

you didnt do poop but remove the gm part o-o wow give yourself a pat on the back you did something my 6 year old sister could go -.-

there are alot of people that have no clue in programing, so even this kind of releases helping them.
 
Junior Spellweaver
Joined
Apr 15, 2007
Messages
154
Reaction score
0
Re: [release]Making none GM commands

there are alot of people that have no clue in programing, so even this kind of releases helping them.


no since this has been released in a version were you dont have to delete full gm commands so even for complete idiots this release is still worthless thank you >.~
 
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
Re: [release]Making none GM commands

You don't need to remove/delete GM command please read or learn programming -_-

You need to put it above your GM commands and change the "if" statement of !map to "else if"
 
Skilled Illusionist
Joined
Apr 6, 2008
Messages
389
Reaction score
1
Re: [release]Making none GM commands

Um, I released a working separation of GM, User, and Premium member commands a LONG time ago, and even included it inside my TGMS v.01L repack, which is posted on these forums.

I apologize for my rudeness, and I was "partially" wrong because I didn't notice the "if (!player->isGM())) return;" at the bottom. And the reason I said "partially" is because this is a VERY sloppy way to program it, and definitely reduces public quality and understandability.

Do this instead:

Code:
void Players::chatHandler(Player* player, unsigned char* packet){
	char chat[91];
	int chatsize = getShort(packet);
	getString(packet+2, chatsize, chat);
	if(chat[0] == '!'){
		char* next_token;
		char command[90] = "";
		if(chatsize>2)
			strcpy_s(command, 90, strtok_s(chat+1, " ", &next_token));
                if(player->isGM()){

// GM Commands

                }

                else {

// User Commands

if(strcmp(command, "nxbottom") == 0){
			Shops::showShop(player, 9040001);
		}
		else if(strcmp(command, "nxglove") == 0){
			Shops::showShop(player, 9040002);
		}
		else if(strcmp(command, "nxshield") == 0){
			Shops::showShop(player, 9100002);
		}
		else if(strcmp(command, "nxshoe") == 0){
			Shops::showShop(player, 9100003);
		}
		else if(strcmp(command, "nxtop") == 0){
			Shops::showShop(player, 9100004);
		}
		else if(strcmp(command, "nxring") == 0){
			Shops::showShop(player, 9300001);
		}
		else if(strcmp(command, "nxhat1") == 0){
			Shops::showShop(player, 9300002);
		}
		else if(strcmp(command, "nxhat2") == 0){
			Shops::showShop(player, 9300003);
		}
		else if(strcmp(command, "nxemote") == 0 || strcmp(command, "nxeffect") == 0){
			Shops::showShop(player, 9300004);
		}
		else if(strcmp(command, "nxoverall") == 0){
			Shops::showShop(player, 9300005);
		}
		else if(strcmp(command, "nxweapon") == 0){
			Shops::showShop(player, 9300006);
		}
		else if(strcmp(command, "nxearring") == 0){
			Shops::showShop(player, 9300007);
		}
		else if(strcmp(command, "nxcoupon") == 0){
			Shops::showShop(player, 9300008);
		}
		else if(strcmp(command, "nxeye") == 0){
			Shops::showShop(player, 9300009);
		}
		else if(strcmp(command, "nxcape") == 0){
			Shops::showShop(player, 9310008);
		}
		else if(strcmp(command, "mapleshop") == 0){
			Shops::showShop(player, 100);
		}
		else if(strcmp(command, "scrollshop") == 0){
			Shops::showShop(player, 1052012);
		}
           }
      }
}
 
Junior Spellweaver
Joined
Apr 15, 2007
Messages
154
Reaction score
0
Re: [release]Making none GM commands

Um, I released a working separation of GM, User, and Premium member commands a LONG time ago, and even included it inside my TGMS v.01L repack, which is posted on these forums.

I apologize for my rudeness, and I was "partially" wrong because I didn't notice the "if (!player->isGM())) return;" at the bottom. And the reason I said "partially" is because this is a VERY sloppy way to program it, and definitely reduces public quality and understandability.

Do this instead:

Code:
void Players::chatHandler(Player* player, unsigned char* packet){
    char chat[91];
    int chatsize = getShort(packet);
    getString(packet+2, chatsize, chat);
    if(chat[0] == '!'){
        char* next_token;
        char command[90] = "";
        if(chatsize>2)
            strcpy_s(command, 90, strtok_s(chat+1, " ", &next_token));
                if(player->isGM()){

// GM Commands

                }

                else {

// User Commands

if(strcmp(command, "nxbottom") == 0){
            Shops::showShop(player, 9040001);
        }
        else if(strcmp(command, "nxglove") == 0){
            Shops::showShop(player, 9040002);
        }
        else if(strcmp(command, "nxshield") == 0){
            Shops::showShop(player, 9100002);
        }
        else if(strcmp(command, "nxshoe") == 0){
            Shops::showShop(player, 9100003);
        }
        else if(strcmp(command, "nxtop") == 0){
            Shops::showShop(player, 9100004);
        }
        else if(strcmp(command, "nxring") == 0){
            Shops::showShop(player, 9300001);
        }
        else if(strcmp(command, "nxhat1") == 0){
            Shops::showShop(player, 9300002);
        }
        else if(strcmp(command, "nxhat2") == 0){
            Shops::showShop(player, 9300003);
        }
        else if(strcmp(command, "nxemote") == 0 || strcmp(command, "nxeffect") == 0){
            Shops::showShop(player, 9300004);
        }
        else if(strcmp(command, "nxoverall") == 0){
            Shops::showShop(player, 9300005);
        }
        else if(strcmp(command, "nxweapon") == 0){
            Shops::showShop(player, 9300006);
        }
        else if(strcmp(command, "nxearring") == 0){
            Shops::showShop(player, 9300007);
        }
        else if(strcmp(command, "nxcoupon") == 0){
            Shops::showShop(player, 9300008);
        }
        else if(strcmp(command, "nxeye") == 0){
            Shops::showShop(player, 9300009);
        }
        else if(strcmp(command, "nxcape") == 0){
            Shops::showShop(player, 9310008);
        }
        else if(strcmp(command, "mapleshop") == 0){
            Shops::showShop(player, 100);
        }
        else if(strcmp(command, "scrollshop") == 0){
            Shops::showShop(player, 1052012);
        }
           }
      }
}


thats what i was explaining but this tard is persistent
 
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
Re: [release]Making none GM commands

Well he got a point but then you need to remove you GM commands and put them in again. i made it so you only have to change the top of chathandler and not everything.
 
Initiate Mage
Joined
May 4, 2008
Messages
3
Reaction score
0
Re: [release]Making none GM commands

the codes does the same thing lol, just another place for the check...
 
Junior Spellweaver
Joined
Jul 30, 2005
Messages
100
Reaction score
4
Re: [release]Making none GM commands

Well he got a point but then you need to remove you GM commands and put them in again. i made it so you only have to change the top of chathandler and not everything.
And you said people need to learn to read/program? Geez.. for his way you don't have to remove all the GM commands, they just aren't in there, else the copied text would be way too dam long.
 
Junior Spellweaver
Joined
Apr 15, 2007
Messages
154
Reaction score
0
Re: [release]Making none GM commands

Well he got a point but then you need to remove you GM commands and put them in again. i made it so you only have to change the top of chathandler and not everything.


dude all your code did was make things complicated -.-
fail
 
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
Re: [release]Making none GM commands

And you said people need to learn to read/program? Geez.. for his way you don't have to remove all the GM commands, they just aren't in there, else the copied text would be way too dam long.

I ment it to chrisrogers not crucio

Because he can
 
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
Re: [release]Making none GM commands

I diddn't make it complicated I just putted the none GM commands before the file was looking if you are a GM so it actually makes sence -_-
And if you use crucio's way only none GMs can use their own commands and GMs can't
With my way both GMs and none GMs can use none GM commands
 
Junior Spellweaver
Joined
Apr 15, 2007
Messages
154
Reaction score
0
Re: [release]Making none GM commands

I diddn't make it complicated I just putted the none GM commands before the file was looking if you are a GM so it actually makes sence -_-

lol no what you did was help waist bandwith on this forum

im out //fail witch
 
Skilled Illusionist
Joined
Apr 6, 2008
Messages
389
Reaction score
1
Re: [release]Making none GM commands

He didn't fail.

It's not a bad example, and honestly, it's a better release than half of the other poop I've seen lately.

It may be sloppy code, but hey; it gets the job done. And that's what we need, right? We need to get the job done.

My method is just a tad less sloppy and more easily understood. That's the only noticeable difference.

In efficiency, both these codes are working and no noticeable difference can be made by the human eye, so please don't criticize him.

Overall, his release is better than the others that have been "released" on this site and as a matter of fact, his code contains no errors which is WAY better than other people's on this site.

But if you want to separate commands, I suggest you use my method as it's easier to understand, especially if you're new to programming.
 
Status
Not open for further replies.
Back
Top