ArcEmu: Custom Command - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

Custom Command Please help

#1 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 05:33 PM

Okay I am not a complete C++ noob but right now I am feeling like one, I have the command all setup in the core, it is just getting the command to read the args I type.

Here is what I have.

bool ChatHandler::HandleMyCommandCommand(const char* args, WorldSession *m_session)
{
	Player * pPlayer = m_session->GetPlayer();
	pPlayer->BroadcastMessage("You typed: %s", args);
		if (args == "test" )


The problem is the server is reading test, but when it hits the if statement it goes past it because it doesn't = "test", I setup another message at the end to catch it if it passes through all the if's I have setup, and it always passes to the else. What am I doing wrong here?
0

#2 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 14 October 2010 - 05:41 PM

View PostDemonicpenguin, on 14 October 2010 - 05:33 PM, said:

Okay I am not a complete C++ noob

Posting this was the first mistake, because you are.

"args" is a pointer to a C-style string (const char*). Which is an array of characters, terminated with a \0.
Now you are trying to compare it with another C-style string "test", but with a simple equality comparison operator (==), which in this case compares the pointers not the strings!!!!!!!!!!!
Do you have mad cow disease or something?

I suggest you to visit this link, you will find some goodies that will help:
http://goo.gl/pzVa

Knowing "The C++ programming language" is the bare minimum that you need before even dreaming of ever touching Arcemu's source code!!!
"The demand for free goods is infinite."
3

#3 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 05:54 PM

By not being a complete noob I meant I have some understanding of the language.
Thank you for your help... but I would like a way to fix this instead of buying a book. I see the type of mistake I made but I would like a solution and not telling me I am a moron. If you can't say it in a good way leave it for someone else to answer.
0

#4 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 14 October 2010 - 06:03 PM

View PostDemonicpenguin, on 14 October 2010 - 05:54 PM, said:

By not being a complete noob I meant I have some understanding of the language.
Thank you for your help... but I would like a way to fix this instead of buying a book. I see the type of mistake I made but I would like a solution and not telling me I am a moron. If you can't say it in a good way leave it for someone else to answer.

No you don't know squat about the language. The mistake you made is very very very very very very basic.
Having seen something != knowing something.

We are not a school. Arcemu is not about learning and/or teaching "The C++ programming language" especially not the basics of it.
If you want that, go to school, or buy a book and self-teach it.

Anyone who tells you how to do this right gets banned.
"The demand for free goods is infinite."
2

#5 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 06:27 PM

You really do not have anything better to do then insult people and show your in power by banning anyone who is trying to be a helpful member of the community. That is pretty sad in my book, I do wonder if this is what you do all day. If you decide to rage because you know I am right and you going to make some smart remark to this post and then ban me because of this stupid post then so be it I don't really care. I thought this was a community of supporting the development of arcemu, guess I am a noob for thinking that aswell. Feel free to reply back dfighter but I am done with this conversation. Thanks for nothing.
0

#6 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 14 October 2010 - 06:42 PM

View PostDemonicpenguin, on 14 October 2010 - 06:27 PM, said:

You really do not have anything better to do then insult people and show your in power by banning anyone who is trying to be a helpful member of the community. That is pretty sad in my book, I do wonder if this is what you do all day. If you decide to rage because you know I am right and you going to make some smart remark to this post and then ban me because of this stupid post then so be it I don't really care. I thought this was a community of supporting the development of arcemu, guess I am a noob for thinking that aswell. Feel free to reply back dfighter but I am done with this conversation. Thanks for nothing.

Alright let's start with your grammar.
"anything better to do then" <---- Incorrect. When comparing you write "than" not "then". Even if they sound alike.
"show your in power" <---- Incorrect. "Your" is used in correlation with possession like as in "your property". In this case you write "you're" since it's a shortening of "you are".

Teaching you basic C++ doesn't help Arcemu. Actually it's just a waste of time and effort. If you really cared and weren't lazy you would have bought a book, or borrowed one from a library. That can teach you the basics, and then you can do all this without any help and be an actual helpful member of the community after a while.

Yes this is a community to support the development of Arcemu not the development of your knowledge of basic C++. That's why I told you that we are not a school. So yes you had a very bad idea if you thought we were gonna teach you the basics of C++. I gave you a link where you can buy books, you can also try to use Google and find some free university notes, or such about "the C++ programming language."

Me raging over you and your post? I think you think a bit too much of yourself. Maybe look into a mirror and think about it?
The only thing in this situation that is even remotely annoying is that we always get your kind here and not the kind who can actually help

Can I get rude points now?
"The demand for free goods is infinite."
5

#7 User is offline   Garvey 

  • is a cool guy
  • Group: Super Moderator
  • Posts: 331
  • Joined: 23-November 09
  • Gender:Male
  • Location:England
  • Server OS:Windows

Posted 14 October 2010 - 07:29 PM

+rep mang
But I, being poor, have only my dreams;
I have spread my dreams under your feet;
Tread softly because you tread on my dreams.
0

#8 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 07:36 PM

Well I made it work. So close or delete this topic if you cba.
0

#9 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 14 October 2010 - 07:53 PM

View PostDemonicpenguin, on 14 October 2010 - 07:36 PM, said:

Well I made it work. So close or delete this topic if you cba.

Actually I even pinned it.
It shows a great example of the junk we don't need ( your problems regarding basic C++ ) :P

Of course if you have a problem with Arcemu actually you are more than welcome to post and you will get help with that.
The same it true about actual contributions.
"The demand for free goods is infinite."
2

#10 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 08:02 PM

Well at least I have received a good laugh tonight.
0

#11 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 14 October 2010 - 08:10 PM

View PostDemonicpenguin, on 14 October 2010 - 08:02 PM, said:

Well at least I have received a good laugh tonight.

It's always nice if you can laugh on your own misery. Too bad I can no longer laugh because we have so many of your kind that it got boring :P
"The demand for free goods is infinite."
1

#12 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 14 October 2010 - 08:23 PM

Tell users to learn, they will spit in your eye.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
1

#13 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 08:38 PM

View PostDemonicpenguin, on 14 October 2010 - 06:27 PM, said:

You really do not have anything better to do then insult people


I got that right.

Now to wait for you to say the same thing.
0

#14 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 14 October 2010 - 08:40 PM

View PostDemonicpenguin, on 14 October 2010 - 08:38 PM, said:

I got that right.

Now to wait for you to say the say thing.

https://www.ohloh.ne...counts/dfighter
+ I was studying all day pretty much
Enough to do?
"The demand for free goods is infinite."
0

#15 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 08:46 PM

That does not really show from our conversation. You had to go out of your way to show why I was wrong. Give me a simple answer to fix or simply don't respond to the post and this would have all been done.
0

#16 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 14 October 2010 - 08:58 PM

View PostDemonicpenguin, on 14 October 2010 - 08:46 PM, said:

That does not really show from our conversation. You had to go out of your way to show why I was wrong. Give me a simple answer to fix or simply don't respond to the post and this would have all been done.

Oh I see you are a true Internet keyboard knight.

So now you are telling me how I am supposed to behave on my own forums, after trying to leech some help and getting a slap in the face for it?

Don't you think you should just shut up, learn your lesson and move on?

I told you where to get help, if you can't even read a damned book and you need people to spoonfeed you then you are not much of an asset for us here.

Btw what happened to the

View PostDemonicpenguin, on 14 October 2010 - 06:27 PM, said:

Feel free to reply back dfighter but I am done with this conversation. Thanks for nothing.

?????
"The demand for free goods is infinite."
1

#17 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 09:12 PM

Quote

Feel free to reply back dfighter but I am done with this conversation. Thanks for nothing.


View PostDemonicpenguin, on 14 October 2010 - 07:36 PM, said:

Well I made it work. So close or delete this topic if you cba.


You then decided to reply after that, as you can see I am not one who would just sit back and be flamed by another.

Quote

Don't you think you should just shut up, learn your lesson and move on?


You started it by complaining at the beginning of this topic, all you had to do was not respond to the post and just let it go unanswered, instead you decided to point out reasons why I was wrong with out solution, if you would have just let it go I would have done a couple of bumps and then just forgotten about it.
0

#18 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 14 October 2010 - 09:43 PM

As usually, users only care at what they can get but never at what they can give. You could help us developing ArcEmu if you learnt C++ but looks like you are not really interested in either the learning and helping parts. Too bad.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
1

#19 User is offline   Demonicpenguin 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 08-March 09

Posted 14 October 2010 - 09:50 PM

View PostSaintJamesApostle, on 14 October 2010 - 09:43 PM, said:

As usually, users only care at what they can get but never at what they can give. You could help us developing ArcEmu if you learnt C++ but looks like you are not really interested in eithervthe learning and helping larts. Too bad.


As dfighter has said I know nothing about C++ so I should not contribute something that is bad that will just start people telling me off.
0

#20 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 14 October 2010 - 09:56 PM

That's why I said "if you learnt C++".
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
1

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users