![]() |
FakeClientCommand
I'm having some problems when it comes to the bots selecting a team. I get this issue when compiling:
Code:
Code:
FakeClientCommand(pEdict, "jointeam", "2", NULL); Code:
D:\Documents and Settings\Administrator.ANDREW\My Documents\csbots\dllapi.cpp(66) : warning C4700: local variable 'pEdict' used without having been initialized |
Re: FakeClientCommand
For firs time I see FakeClientCommand() like this one that you show off
FakeClientCommand(struct edict_s *,char *,char *,char *) Check the headers files *.h and see is the FakeClientCommand() is defined correct there. And don't debug the bot. Configurate it for Release. ;) |
Re: FakeClientCommand
1 Attachment(s)
Setting it to release doesn't work. How should it be defined exactly? And I don't think I have defined pEdict correctly either, how do I do that?
(attached a screenshot) |
Re: FakeClientCommand
/* I should never post without reading more..
* and never post when sleepy.. */ |
Re: FakeClientCommand
this
Code:
error: unresolved external symbol Check if that function exists the way the linker expects to find it. And ignore that warning, it will get away when the problem will be solved. |
Re: FakeClientCommand
How does it expect to find it?
Sorry for all these questions, just not the most fluent programmer there is. :) |
Re: FakeClientCommand
As I see you are fixed the problem with FakeClientCommand().
And it seems that you want to make new bot for CS ? Well isn't your CS version too old? I think that is CS 1.0. Better update to 1.5 or 1.6 and then try again to add bots. And btw to make bot to join directly in team 2 your must call FakeClientCommand() like this one: Code:
FakeClientCommand (pEdict, "menuselect", "2", NULL); Code:
FakeClientCommand (pEdict, "menuselect", "3", NULL); |
Re: FakeClientCommand
Yes, I have added those to commands, but I get a link error:
Linking... Creating library .Debug/csbots.lib and object .Debug/csbots.exp dllapi.obj : error LNK2001: unresolved external symbol "void __cdecl FakeClientCommand(struct edict_s *,char *,char *,char *)" [color=#000000]([email=[/color]"?FakeClientCommand@@YAXPAUedict_s@@PAD11@Z"]?FakeClientCommand@@YAXPAUedict_s@@PAD11@Z[/email]) .Debug/csbots.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe. csbots.dll - 2 error(s), 0 warning(s) |
Re: FakeClientCommand
I told you - Don't debug the bot. It must be for release.
After that Pierre-Marie Baty told you how to fix the problem. |
Re: FakeClientCommand
I just searched the HPB Bot and POD Bot source and it doesn't do anything I haven't done. Is there some code I can use to declare it again or something? I dunno, I'm lost.
|
Re: FakeClientCommand
The linker cannot find where FakeClientCommand is defined..
it is externed but not defined anywhere so the function doesn't exist and the linker can't find it. |
Re: FakeClientCommand
I defined it as:
void FakeClientCommand(edict_t *pBot, char *arg1, char *arg2, char *arg3); Now, if I take it away, i get an error pointing to FakeClientCommand saying undeclared identifier. So what's the linker on about? |
Re: FakeClientCommand
do you have the body of the function defined somewhere?
|
Re: FakeClientCommand
No...
What is the code for it? |
Re: FakeClientCommand
Looking through HPB Bot and POD Bot, I can't find it.
|
Re: FakeClientCommand
Maybe you need by some more C/C++ lesons. ;)
Let me explain: So if you have the function FakeClientCommand() defined in dll.cpp and you want to use it in other *.cpp like bot.cpp you must define it as global function in some header file *.h like bot.h and you must be sure that bot.cpp will use this header. So if the function is defined in dll.cpp in this way: Code:
FakeClientCommand(bla, bla, bla) Code:
FakeClientCommand(bla, bla, bla); And now you can use FakeClientCommand() in every .cpp that will use the bot.h header file. I hope that this will help you. ;) |
Re: FakeClientCommand
...and BTW, the bot can be built either in the DEBUG or in the RELEASE configuration, the only difference will be that in the latter the debug symbols will be stripped out, whereas in the former they're here and all the variables are nulled before use - they aren't in release, their state is undefined.
|
All times are GMT +2. The time now is 23:47. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.