What is the problem?
I trying hook saytext message.
PHP Code:
int MsgHook( const char *szUserMsg, pfnUserMsgHook pfn )
{
int result = gEngfuncs.pfnHookUserMsg( szUserMsg, pfn );
if( !_stricmp( szUserMsg, "SayText" ) ) {
OrigSayTextMsg = pfn;
result = gEngfuncs.pfnHookUserMsg( szUserMsg, SayText );
}
return result;
}
int SayText( const char *pszName, int iSize, void *pbuf )
{
BEGIN_READ( pbuf, iSize );
int kuldo = READ_BYTE( );
char* String1 = READ_STRING( );
char* String2 = READ_STRING( );
char* String3 = READ_STRING( );
char buff[350];
sprintf(buff, "%s %s %s", String1, String2, String3);
WriteLogFile(buff); //This created the log file, and this file is empty
return 1;
//return ( *OrigSayTextMsg )( pszName, iSize, pbuf );
}
Ps: This is client side
__________________