PDA

View Full Version : includes drive me crazy lol


Cr3V3TT3
02-03-2005, 18:01
hi,
how to get the includes i need for a command :? ?

UserMessageBegin((IRecipientFilter &)mrf, "HudMsg" );
WRITE_BYTE ( 3 & 0xFF );
WRITE_FLOAT( ss_hudmsg_x.GetFloat() );
WRITE_FLOAT( ss_hudmsg_y.GetFloat() );
WRITE_BYTE ( ss_hudmsg_red.GetInt() );
WRITE_BYTE ( ss_hudmsg_green.GetInt() );
WRITE_BYTE ( ss_hudmsg_blue.GetInt() );
WRITE_BYTE ( ss_hudmsg_alpha.GetInt() );
WRITE_BYTE ( ss_hudmsg_red.GetInt() );
WRITE_BYTE ( ss_hudmsg_green.GetInt() );
WRITE_BYTE ( ss_hudmsg_blue.GetInt() );
WRITE_BYTE ( ss_hudmsg_alpha.GetInt() );
WRITE_BYTE ( 0 );
WRITE_FLOAT( 0.0 );
WRITE_FLOAT( 0.0 );
WRITE_FLOAT( ss_hudmsg_time.GetInt() );
WRITE_FLOAT( 0 );
WRITE_STRING( mess );
MessageEnd();

When compile that got the errors
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(651) : error C2065: 'UserMessageBegin' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(652) : error C2065: 'WRITE_BYTE' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(653) : error C2065: 'WRITE_FLOAT' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(668) : error C2065: 'WRITE_STRING' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(669) : error C2065: 'MessageEnd' : undeclared identifier
That mean those commands are not registered i think

So try to include dlls\gameinterface.h
But get the errors :
..\..\dlls\gameinterface.h(15) : error C2143: syntax error : missing ';' before '*'
..\..\dlls\gameinterface.h(15) : error C2501: 'g_pStringTableInfoPanel' : missing storage-class or type specifiers
..\..\dlls\gameinterface.h(102) : error C2143: syntax error : missing ';' before '*'
..\..\dlls\gameinterface.h(102) : error C2501: 'ClientPutInServerOverrideFn' : missing storage-class or type specifiers
..\..\dlls\gameinterface.h(104) : error C2146: syntax error : missing ')' before identifier 'fn'
..\..\dlls\gameinterface.h(104) : error C2182: 'ClientPutInServerOverride' : illegal use of type 'void'
..\..\dlls\gameinterface.h(104) : error C2440: 'initializing' : cannot convert from 'int *(__cdecl *)(struct edict_t *,const char *)' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
..\..\dlls\gameinterface.h(104) : error C2059: syntax error : ')'
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(651) : error C2065: 'UserMessageBegin' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(652) : error C2065: 'WRITE_BYTE' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(653) : error C2065: 'WRITE_FLOAT' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(668) : error C2065: 'WRITE_STRING' : undeclared identifier
C:\mymods\SOundsSource\src\utils\Sounds_Sourc e\sounds_source.cpp(669) : error C2065: 'MessageEnd' : undeclared identifier

I think i miss one file but if i add a file i have more errors.....

Do you got any tutorials to help me plz?

Fruchtzwerg
02-03-2005, 21:53
You have to add all needed header files.

Cr3V3TT3
02-04-2005, 15:37
lol :lol:
how to know what are the needed header files
?

Roger Devil
02-05-2005, 04:00
You hav to incldue the following files :
..\..\tier1\bitbuf.cpp
..\..\public\tier1\bitbuf.h


Code is :
bf_write* bfw=engine->UserMessageBegin( &mrf, 3 );
bfw->WriteByte( 1 );
bfw->WriteString( "Simple TextMsg\n");
bfw->WriteByte(1);
engine->MessageEnd();

The number for the messages is in file :
src\game_shared\hl2\hl2_usermessages.cpp

Please note, that HudMsg will not be displayed in Counterstrike-Source.
You can only print to the Chat-Area or HudText(...)
Hope this helps you

Roger Devil

Cr3V3TT3
02-05-2005, 05:38
Thx