Quote:
Originally Posted by rantaki
Is here anyone that can fix it? (except Valve) You will be our hero!
|
Hi, i was looking around for news about the last update and how other people fixed it but i didnt find one solution, then i decided to share this simple fix i did the same day of the update, just replace these 3 parts of the code (version 2.3.3) and recompile.
1. Find this:
PHP Code:
public iChatMessageAll( id, const szMessage[ ], const szSaid[ ] ) // szMessage is safe, generated by OP or plugin. szSaid is unsafe, generated by client
{
message_begin( MSG_BROADCAST, gMsgSayText, .player = id );
write_byte( id );
write_string( szMessage );
write_string( "" );
write_string( szSaid );
message_end( );
}
Replace with this:
PHP Code:
public iChatMessageAll( id, const szMessage[ ], const szSaid[ ] ) // szMessage is safe, generated by OP or plugin. szSaid is unsafe, generated by client
{
new msg[181]; //string to send
new szName[32]; //user who said it
get_user_name(id, szName, 31);
format(msg, 180, szMessage, szName, szSaid); //here we construct the chat before send it
//szMessage contains the format %s1 : %s2
message_begin( MSG_BROADCAST, gMsgSayText, .player = id ); //let's send it
write_byte( id );
write_string(msg);
message_end( );
}
2. Find this:
PHP Code:
if ( ( iSupercedeCheck )
|| ( ( ( ( giAllTalk || ( iAlive && iTempAlive ) ) || ( !iAlive && !iTempAlive ) ) && iTeamCheck && iRadiusCheck && iCanSeeCheck )
|| ( giAdminsSpy && ( has_flag( tid, gszAccesFlags[ FLAG_SPY ] ) || !gszAccesFlags[ FLAG_SPY ][ 0 ] ) )
|| ( is_user_hltv( tid ) ) ) )
{
message_begin( MSG_ONE, gMsgSayText, .player = tid );
write_byte( id );
write_string( szMessage );
write_string( "" );
write_string( szSaid );
message_end( );
}
Replace with this:
PHP Code:
if ( ( iSupercedeCheck )
|| ( ( ( ( giAllTalk || ( iAlive && iTempAlive ) ) || ( !iAlive && !iTempAlive ) ) && iTeamCheck && iRadiusCheck && iCanSeeCheck )
|| ( giAdminsSpy && ( has_flag( tid, gszAccesFlags[ FLAG_SPY ] ) || !gszAccesFlags[ FLAG_SPY ][ 0 ] ) )
|| ( is_user_hltv( tid ) ) ) )
{
new msg[181];
new szName[32];
get_user_name(id, szName, 31);
format(msg, 180, szMessage, szName, szSaid); //again we construct the chat before send it
message_begin( MSG_ONE, gMsgSayText, .player = tid );
write_byte( id );
write_string( msg );
message_end( );
}
3. And finally find this:
PHP Code:
replace_all( szMessage, iMessageLen, "%NAME%", "%s1" );
replace_all( szMessage, iMessageLen, "%MESSAGE%", "%s2" );
replace with this:
PHP Code:
//then we are sure we gonna construct the message correctly
replace_all( szMessage, iMessageLen, "%NAME%", "%s" );
replace_all( szMessage, iMessageLen, "%MESSAGE%", "%s" );
Enjoy it.
PS> I attached the .sma fixed for lazy people