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

Thank you, finally someone who appriciates my time I spent on it.
 
Skilled Illusionist
Joined
Apr 6, 2008
Messages
389
Reaction score
1
Re: [release]Making none GM commands

Thank you, finally someone who appriciates my time I spent on it.

It takes someone who has actually spent a good portion of their life coding to recognize hard work. And once again, I apologize for my previous rude comments. I wasn't intending to be negative; was trying to be blunt.

I hope none of you forget: everyone starts somewhere; you were once a noob too.

And at least Pirate is trying.
 
Junior Spellweaver
Joined
Apr 20, 2008
Messages
139
Reaction score
0
Re: [release]Making none GM commands

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

im out //fail witch


All i've seen you do on topics is flame, let people be appreciated for their work, i dont see you trying to release things -_____-
:poster_ss
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
27
Reaction score
0
Re: [release]Making none GM commands

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

We all knew us, but you didn't so we used our brains before you.
 
Newbie Spellweaver
Joined
Apr 22, 2008
Messages
8
Reaction score
0
Re: [release]Making none GM commands

Quit flaming him please. He's sharing something that he made for the better so gtfo flamers.
 
Newbie Spellweaver
Joined
Apr 13, 2008
Messages
28
Reaction score
0
Re: [release]Making none GM commands

Quit flaming him please. He's sharing something that he made for the better so gtfo flamers.

You are the one who should shutup, saying this doesn't make the thread any useful.

To the thread starter: There had been many guides and releases on how to separate the GM commands and User Commands, and though you have put some effort on this, like ChrisRogers said, this isn't the best way to do it, you might as well edit this to a better version or otherwise remove it, because this will only cause more inefficient code in any C++ sources or repacks or whatever.
 
Skilled Illusionist
Joined
Apr 11, 2008
Messages
302
Reaction score
0
Re: [release]Making none GM commands

Ok this is my script but the commands for players doesnt work..

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
else if(strcmp(command, "save") == 0) {
player->save();
PlayersPacket::showMassage("You have saved your progress successfully", 5);
}
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, "online") == 0) {
PlayersPacket::showNoticeOneChar("Characters online: ", 5, player);
for (hash_map <int, Player*>::iterator iter = Players::players.begin(); iter != Players::players.end(); iter++)
PlayersPacket::showNoticeOneChar(iter->second->getName(), 5, player);
}
//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
if(strcmp(command, "map") == 0){
if(strlen(next_token) == 0){
PlayersPacket::ShowNotice(player, "Enter a Map ID", 1);
PlayersPacket::ShowNotice(player, "180000000 - GM Map", 6);
PlayersPacket::ShowNotice(player, "001010000 - Amherst", 6);
PlayersPacket::ShowNotice(player, "000060000 - Southperry", 6);
PlayersPacket::ShowNotice(player, "104000000 - Lith Harbor", 6);
PlayersPacket::ShowNotice(player, "101000000 - Ellinia", 6);
PlayersPacket::ShowNotice(player, "102000000 - Perion", 6);
PlayersPacket::ShowNotice(player, "103000000 - Kerning City", 6);
PlayersPacket::ShowNotice(player, "100000000 - Henesys", 6);
PlayersPacket::ShowNotice(player, "105040300 - Sleepywood", 6);
PlayersPacket::ShowNotice(player, "110000000 - Florina Beach", 6);
PlayersPacket::ShowNotice(player, "200000000 - Orbis", 6);
PlayersPacket::ShowNotice(player, "211000000 - El Nath", 6);
PlayersPacket::ShowNotice(player, "220000000 - Ludibrium", 6);
PlayersPacket::ShowNotice(player, "230000000 - Aqua Road", 6);
PlayersPacket::ShowNotice(player, "221000000 - Omega Sector", 6);
PlayersPacket::ShowNotice(player, "222000000 - Korean Folk Town", 6);
PlayersPacket::ShowNotice(player, "250000000 - Mu Lung", 6);
PlayersPacket::ShowNotice(player, "251000000 - Herb Town", 6);
PlayersPacket::ShowNotice(player, "240000000 - Leafre", 6);
PlayersPacket::ShowNotice(player, "600000000 - New Leaf City", 6);
PlayersPacket::ShowNotice(player, "680000000 - Amoria", 6);
PlayersPacket::ShowNotice(player, "100000005 - Mushmom", 6);
PlayersPacket::ShowNotice(player, "105070002 - Zombie Mushmom", 6);
PlayersPacket::ShowNotice(player, "280030000 - Zakum's Altar", 6);
PlayersPacket::ShowNotice(player, "240060200 - Horned Tail's Cave", 6);
PlayersPacket::ShowNotice(player, "220080001 - Origin of Clocktower", 6);
PlayersPacket::ShowNotice(player, "230040420 - Cave of Pianus", 6);
PlayersPacket::ShowNotice(player, "240020401 - Manon's Forest", 6);
PlayersPacket::ShowNotice(player, "240020101 - Griffey's Forest", 6);
}
 
Newbie Spellweaver
Joined
May 15, 2008
Messages
15
Reaction score
0
Re: [release]Making none GM commands

to sean360:
the first command (player command) is an "else if" statement not an "if"
and the first GM command is an "if" statement which must be an "else if" statement since you used none gm commands.
so it should look like 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));
//none GM commands bellow, the first command must be an "if" statement
if(strcmp(command, "save") == 0) { // I changed "else if" into "if"
player->save();
PlayersPacket::showMassage("You have saved your progress successfully", 5);
}
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, "online") == 0) {
PlayersPacket::showNoticeOneChar("Characters online: ", 5, player);
for (hash_map <int, Player*>::iterator iter = Players::players.begin(); iter != Players::players.end(); iter++)
PlayersPacket::showNoticeOneChar(iter->second->getName(), 5, player);
}
//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
else if(strcmp(command, "map") == 0){ // I changed "if" into "else if"
if(strlen(next_token) == 0){
PlayersPacket::ShowNotice(player, "Enter a Map ID", 1);
PlayersPacket::ShowNotice(player, "180000000 - GM Map", 6);
PlayersPacket::ShowNotice(player, "001010000 - Amherst", 6);
PlayersPacket::ShowNotice(player, "000060000 - Southperry", 6);
PlayersPacket::ShowNotice(player, "104000000 - Lith Harbor", 6);
PlayersPacket::ShowNotice(player, "101000000 - Ellinia", 6);
PlayersPacket::ShowNotice(player, "102000000 - Perion", 6);
PlayersPacket::ShowNotice(player, "103000000 - Kerning City", 6);
PlayersPacket::ShowNotice(player, "100000000 - Henesys", 6);
PlayersPacket::ShowNotice(player, "105040300 - Sleepywood", 6);
PlayersPacket::ShowNotice(player, "110000000 - Florina Beach", 6);
PlayersPacket::ShowNotice(player, "200000000 - Orbis", 6);
PlayersPacket::ShowNotice(player, "211000000 - El Nath", 6);
PlayersPacket::ShowNotice(player, "220000000 - Ludibrium", 6);
PlayersPacket::ShowNotice(player, "230000000 - Aqua Road", 6);
PlayersPacket::ShowNotice(player, "221000000 - Omega Sector", 6);
PlayersPacket::ShowNotice(player, "222000000 - Korean Folk Town", 6);
PlayersPacket::ShowNotice(player, "250000000 - Mu Lung", 6);
PlayersPacket::ShowNotice(player, "251000000 - Herb Town", 6);
PlayersPacket::ShowNotice(player, "240000000 - Leafre", 6);
PlayersPacket::ShowNotice(player, "600000000 - New Leaf City", 6);
PlayersPacket::ShowNotice(player, "680000000 - Amoria", 6);
PlayersPacket::ShowNotice(player, "100000005 - Mushmom", 6);
PlayersPacket::ShowNotice(player, "105070002 - Zombie Mushmom", 6);
PlayersPacket::ShowNotice(player, "280030000 - Zakum's Altar", 6);
PlayersPacket::ShowNotice(player, "240060200 - Horned Tail's Cave", 6);
PlayersPacket::ShowNotice(player, "220080001 - Origin of Clocktower", 6);
PlayersPacket::ShowNotice(player, "230040420 - Cave of Pianus", 6);
PlayersPacket::ShowNotice(player, "240020401 - Manon's Forest", 6);
PlayersPacket::ShowNotice(player, "240020101 - Griffey's Forest", 6);
}

hope it helped. :D
 
Status
Not open for further replies.
Back
Top