View Single Post
GunGameR
Junior Member
Join Date: Jul 2017
Old 07-17-2017 , 14:22   Re: iChat 2.3.3 - The most powerful chat manager
Reply With Quote #252

Quote:
Originally Posted by rantaki View Post
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 iChatMessageAllid, const szMessage[ ], const szSaid[ ] ) // szMessage is safe, generated by OP or plugin. szSaid is unsafe, generated by client
{
    
message_beginMSG_BROADCASTgMsgSayText, .player id );
    
write_byteid );
    
write_stringszMessage );
    
write_string"" );
    
write_stringszSaid );
    
message_end( );

Replace with this:
PHP Code:
public iChatMessageAllid, 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(idszName31);
    
format(msg180szMessageszNameszSaid); //here we construct the chat before send it
                                            //szMessage contains the format %s1 : %s2
    
message_beginMSG_BROADCASTgMsgSayText, .player id ); //let's send it
    
write_byteid );
    
write_string(msg);
    
message_end( );


2. Find this:
PHP Code:
if ( ( iSupercedeCheck )
        || ( ( ( ( 
giAllTalk || ( iAlive && iTempAlive ) ) || ( !iAlive && !iTempAlive ) ) && iTeamCheck && iRadiusCheck && iCanSeeCheck )
        || ( 
giAdminsSpy && ( has_flagtidgszAccesFlagsFLAG_SPY ] ) || !gszAccesFlagsFLAG_SPY ][ ] ) )
        || ( 
is_user_hltvtid ) ) ) )
        {
            
message_beginMSG_ONEgMsgSayText, .player tid );
            
write_byteid );
            
write_stringszMessage );
            
write_string"" );
            
write_stringszSaid );
            
message_end( );
        } 
Replace with this:
PHP Code:
if ( ( iSupercedeCheck )
        || ( ( ( ( 
giAllTalk || ( iAlive && iTempAlive ) ) || ( !iAlive && !iTempAlive ) ) && iTeamCheck && iRadiusCheck && iCanSeeCheck )
        || ( 
giAdminsSpy && ( has_flagtidgszAccesFlagsFLAG_SPY ] ) || !gszAccesFlagsFLAG_SPY ][ ] ) )
        || ( 
is_user_hltvtid ) ) ) )
        {
            new 
msg[181];
            new 
szName[32];
            
get_user_name(idszName31);
            
format(msg180szMessageszNameszSaid); //again we construct the chat before send it
            
message_beginMSG_ONEgMsgSayText, .player tid );
            
write_byteid );
            
write_stringmsg );
            
message_end( );
            
        } 

3. And finally find this:
PHP Code:
replace_allszMessageiMessageLen"%NAME%""%s1" );
    
replace_allszMessageiMessageLen"%MESSAGE%""%s2" ); 
replace with this:
PHP Code:
//then we are sure we gonna construct the message correctly
    
replace_allszMessageiMessageLen"%NAME%""%s" );
    
replace_allszMessageiMessageLen"%MESSAGE%""%s" ); 
Enjoy it.
PS> I attached the .sma fixed for lazy people
Attached Files
File Type: sma Get Plugin or Get Source (iChat_2.3.3-GunGameR_Fix.sma - 881 views - 36.4 KB)

Last edited by GunGameR; 07-17-2017 at 14:30.
GunGameR is offline