Author |
Message |
JaqMs14 Guest
Offline
|
Posted: Tue Jul 20, 2004 11:02 pm Post subject: player name help |
 |
|
|
|
Ok, I am making a command: !makeguesser [name]. I put the things for input in commands.cpp but now I need to know how to make it so that the name specified will be changed to a certain frequency and ship. Help? |
|
Back to top |
|
 |
Underlord Novice
Gender: Joined: Feb 17 2004 Posts: 55 Offline
|
|
Back to top |
|
 |
JaqMs14 Guest
Offline
|
Posted: Wed Jul 21, 2004 1:32 am Post subject: |
 |
|
|
|
It says "strcmp" is has an undeclared identifier. How do I declare it? |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Wed Jul 21, 2004 2:35 am Post subject: |
 |
|
|
|
#include "string.h" _________________ 4,691 irradiated haggis! |
|
Back to top |
|
 |
Doggeti Server Help Squatter

Age:40 Gender: Joined: Jan 12 2003 Posts: 297 Location: Germany Offline
|
Posted: Wed Jul 21, 2004 5:21 am Post subject: |
 |
|
|
|
Isn't it dangerous to declare a second Player *p. The function botInfo::gotCommand allready has a parameter Player *p. _________________ Expect the worst but hope for the best. |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Wed Jul 21, 2004 7:39 am Post subject: |
 |
|
|
|
depends on your compiler, it will spit out an error if it has a problem. Else it is fine. You could also do parse->item->name, no need for a pointer |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Wed Jul 21, 2004 7:43 am Post subject: |
 |
|
|
|
It looks better to do "p = parse->item", though; How do you code, 50%?
Without code? |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Wed Jul 21, 2004 10:37 am Post subject: |
 |
|
|
|
While I think it's bad style, declaring a variable of the same name inside any braces creates a new "version" that is locally scoped. As soon as you leave the braces, the higher level one "exists" again. This is a C standard. |
|
Back to top |
|
 |
Underlord Novice
Gender: Joined: Feb 17 2004 Posts: 55 Offline
|
|
Back to top |
|
 |
|