View Single Post
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-10-2022 , 17:19   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #218

I tested this plugin and liked it but I have comment and suggest:

The comment:
PHP Code:
CheckAccountsid )
{
    new 
szPasswordMAX_PASSWORD_LENGTH ];

    
get_user_infoid"_pw"szPasswordcharsmaxszPassword ) );
        
    if( 
TrieGetArrayg_tDatabaseg_iPlayerid ][ AuthID ], eDatasizeof eData ) || TrieGetArrayg_tDatabaseg_iPlayerid ][ Name ], eDatasizeof eData ) || TrieGetArrayg_tDatabaseg_iPlayerid ][ IP ], eDatasizeof eData ))
    {
        if( ( 
eDataPlayer_Password ][ ] && equaleDataPlayer_Password ], szPassword ) ) || !eDataPlayer_Password ][ ] )
        {
            if( 
eDataPlayer_Prefix ][ ] )
            {
                
cm_set_user_prefixideDataPlayer_Prefix ] )
            }
            
            if( 
eDataPlayer_Flags ][ ] )
            {
                
remove_user_flagsid );
                
set_user_flagsidread_flagseDataPlayer_Flags ] ) );
            }
            
            if( 
eDataPlayer_VIPFlags ][ ] )
            {
                
g_iPlayerid ][ VIP ] |= read_flagseDataPlayer_VIPFlags ] );
            }
        }
        
        else if( 
eDataPlayer_Password ][ ] && ! equaleDataPlayer_Password ], szPassword ) )
        {
            
server_cmd"kick #%d ^"You have no entry to this server^""get_user_useridid ) );   
        }
    }

As you can see I want to create a custom prefix from another file, This native "cm_set_user_prefix" work like replace the old prefix to the new one, So if I don't put anything in the 'Custom Prefix' or 'Admin Prefix' etc section of the 'ChatManager.ini' file, the prefix will not appear but the colorful chat will appear.

PHP Code:
funcUpdateData(id)
//g_ePlayerData[id][PDATA_PREFIX][0] = EOS // Disable this line 
The suggest:
I suggest you to add swear filter or anti swearing etc.:
PHP Code:
for( new szSwearMAX_FMT_LENGTH ], iPosiArraySizeg_aSwearFilter ); i++ )
        {
            
ArrayGetStringg_aSwearFilteriszSwearcharsmaxszSwear ) );
            
            if( ( 
iPos containiszArgsszSwear ) ) != -
            {
                new 
iLen strlenszSwear )
                while( 
iLen-- )
                {
                    
szArgsiPos++ ] = '*';  
                }
            }
        } 
Edit: Clear data when the client is disconnected, clear the prefix variable only when the client is connected and disconnected or create a custom variable for the prefix native
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 03-21-2022 at 18:11.
Supremache is offline