Raised This Month: $12 Target: $400
 3% 

Print to chat area...


Post New Thread Reply   
 
Thread Tools Display Modes
BeetleFart
SourceMod Donor
Join Date: Apr 2004
Old 12-14-2004 , 04:39  
Reply With Quote #21

Quote:
Originally Posted by Fruchtzwerg
Use SayText usermessage for this, it will show chat messages on screen.
Fruchtzwerg, thanks a million for letting me know how to do this,
I have added this functionality into may admin.dll and its made it better
10 fold.


If you have any Idea how to trap say messages from clients that would be truly great!
BeetleFart is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 12-14-2004 , 05:14  
Reply With Quote #22

Code:
typedef int (__stdcall* usermessages_LookupUserMessageFunc)( const char *name );
static unsigned long g_ecx;
static unsigned long g_oldret;
__declspec(naked) void usermessages_LookupUserMessage__(){
	__asm{
		//int 03
		mov g_ecx, ecx //paranoia :/
		pop g_oldret
		mov ecx, 0x22543208
		mov eax, 0x22019260
		call eax
		mov ecx, g_ecx
		push g_oldret
		ret
	}
}
usermessages_LookupUserMessageFunc usermessages_LookupUserMessage = (usermessages_LookupUserMessageFunc)usermessages_LookupUserMessage__;
Again, not for noobs. I've still got to get the Filter class working, but bf_write is a snap. If you guys have filter working this should be all you need. This is the nasty version - I have the auto updating one here. Yeah yeah yeah, just use it for the time being
vancelorgin is offline
Fruchtzwerg
Member
Join Date: Dec 2004
Old 12-14-2004 , 05:28  
Reply With Quote #23

Doh. There is also a safer way. Just use the CON_COMMAND and register say as a command. But you have to log and fire the say commands back to the clients by yourself.
__________________
Fruchtzwerg is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 12-14-2004 , 05:52  
Reply With Quote #24

Yeah, but you're gonna need that code to send any other messages.

(0x223C9330 and 0x22016A00 for CS:S atm..)
vancelorgin is offline
BeetleFart
SourceMod Donor
Join Date: Apr 2004
Old 12-14-2004 , 08:13  
Reply With Quote #25

Quote:
Originally Posted by vancelorgin
Code:
typedef int (__stdcall* usermessages_LookupUserMessageFunc)( const char *name );
static unsigned long g_ecx;
static unsigned long g_oldret;
__declspec(naked) void usermessages_LookupUserMessage__(){
	__asm{
		//int 03
		mov g_ecx, ecx //paranoia :/
		pop g_oldret
		mov ecx, 0x22543208
		mov eax, 0x22019260
		call eax
		mov ecx, g_ecx
		push g_oldret
		ret
	}
}
usermessages_LookupUserMessageFunc usermessages_LookupUserMessage = (usermessages_LookupUserMessageFunc)usermessages_LookupUserMessage__;
Again, not for noobs. I've still got to get the Filter class working, but bf_write is a snap. If you guys have filter working this should be all you need. This is the nasty version - I have the auto updating one here. Yeah yeah yeah, just use it for the time being

Im too much of a noob to understand this completely.
I however did at least paste it in to the project and compiled it with no problems and moved the usermessages_LookupUserMessage variable to initialize in the constructor for my plugin class (assuming i read the usermessages_LookupUserMessage line correctly that that is a variable)
and Its doesnt get called ever that I can see...
can you clarify this a little for me?
BeetleFart is offline
BeetleFart
SourceMod Donor
Join Date: Apr 2004
Old 12-14-2004 , 08:15  
Reply With Quote #26

Quote:
Originally Posted by Fruchtzwerg
Doh. There is also a safer way. Just use the CON_COMMAND and register say as a command. But you have to log and fire the say commands back to the clients by yourself.

I tried making a CON_COMMAND(say,"say Messages")
function and it doesnt fire, although users say messages stop going to the server, they dont appear to fire this, a breakpoint in there never hits.
BeetleFart is offline
Fruchtzwerg
Member
Join Date: Dec 2004
Old 12-14-2004 , 08:46  
Reply With Quote #27

Try CON_COMMAND_F with flag FCVAR_GAMEDLL set.
__________________
Fruchtzwerg is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 12-14-2004 , 10:14  
Reply With Quote #28

Quote:
Originally Posted by BeetleFart
Im too much of a noob to understand this completely.
I however did at least paste it in to the project and compiled it with no problems and moved the usermessages_LookupUserMessage variable to initialize in the constructor for my plugin class (assuming i read the usermessages_LookupUserMessage line correctly that that is a variable)
and Its doesnt get called ever that I can see...
can you clarify this a little for me?
That code's useless is what it is I just found pGameDLL->GetUserMessageInfo - use that to fill a list of names. What that code did was call usermessages->LookupUserMesasge
vancelorgin is offline
Eradicator
Junior Member
Join Date: Dec 2004
Location: Canada
Old 12-14-2004 , 14:40  
Reply With Quote #29

Quote:
Originally Posted by Fruchtzwerg
As you derive any other class in C++:

Code:
class CMyRecipientFilter : public IRecipientFilter
and then implement all functions from the interface.
You mean like so:
Code:
class MRecipientFilter : public IRecipientFilter 
{ 
public: 
   MRecipientFilter(void); 
   ~MRecipientFilter(void); 

   virtual bool IsReliable( void ) const; 
   virtual bool IsInitMessage( void ) const; 

   virtual int GetRecipientCount( void ) const; 
   virtual int GetRecipientIndex( int slot ) const; 
   void AddAllPlayers( int maxClients ); 
   void AddPlayer(int index);


private: 
   bool m_bReliable; 
   bool m_bInitMessage; 
   CUtlVector< int > m_Recipients; 
};
Thats exatly what I have... o_O
Eradicator is offline
Send a message via MSN to Eradicator
Fruchtzwerg
Member
Join Date: Dec 2004
Old 12-14-2004 , 16:32  
Reply With Quote #30

So why did you used a cast? A cast is used when you have different types.
__________________
Fruchtzwerg is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode