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

ChatMaganer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 11-19-2020 , 11:59   ChatMaganer
Reply With Quote #1

hello can someone help me already add crx_chatmanager debug. BUT I KEEP SKIPPING THAT ERROR IN THE LOG.

HTML Code:
L 11/18/2020 - 01:12:49: String formatted incorrectly - parameter 4 (total 3)
L 11/18/2020 - 01:12:49: [AMXX] Displaying debug trace (plugin "crx_chatmanager.amxx", version "4.4")
L 11/18/2020 - 01:12:49: [AMXX] Run time error 25: parameter error
L 11/18/2020 - 01:12:49: [AMXX]    [0] cromchat.inc::CC_SendMatched (line 264)
L 11/18/2020 - 01:12:49: [AMXX]    [1] crx_chatmanager.sma::Hook_Say (line 742)

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cromchat>
#include <cstrike>

new const PLUGIN_VERSION[] = "4.4"
const Float:DELAY_ON_REGISTER 1.0
const Float:DELAY_ON_CONNECT 1.0
const Float:DELAY_ON_CHANGE 0.1
const PLACEHOLDER_LENGTH 64
const WRITTEN_MESSAGE_SIZE 120
const FULL_MESSAGE_SIZE 180
new const ERROR_FILE[] = "chatmanager_errors.log"

#if defined replace_string
    #define replace_all replace_string
#endif

/*
    You can comment placeholders you don't need from the lines below and that will completely deactivate them.
    You can also activate the additional ones if you want to use them.
    Feel free to experiment in making your custom ones as well.
*/

#define ARG_ADMIN_PREFIX         "$admin_prefix$"
#define ARG_DEAD_PREFIX         "$dead_prefix$"
#define ARG_TEAM                 "$team$"
#define ARG_NAME                 "$name$"
#define ARG_CUSTOM_NAME            "$custom_name$"
#define ARG_IP                     "$ip$"
#define ARG_STEAM                 "$steam$"
#define ARG_USERID                 "$userid$"
#define ARG_CHAT_COLOR             "$chat_color$"
#define ARG_MESSAGE             "$message$"
#define ARG_TIME                 "$time$"
#define ARG_RANK                 "$rank$"
//#define ARG_CURRENT_XP         "$current_xp$"
//#define ARG_NEXT_XP             "$next_xp$"
//#define ARG_LEVEL             "$level$"
//#define ARG_NEXT_LEVEL         "$next_level$"
//#define ARG_NEXT_RANK         "$next_rank$"
//#define ARG_HEALTH             "$health$"
//#define ARG_ARMOR             "$armor$"
//#define ARG_FRAGS             "$frags$"
//#define ARG_DEATHS             "$deaths$"
//#define ARG_CITY                 "$city$"
//#define ARG_COUNTRY             "$country$"
//#define ARG_COUNTRY_CODE         "$country_code$"
//#define ARG_CONTINENT         "$continent$"
//#define ARG_CONTINENT_CODE     "$continent_code$"

/*    The settings end here. Don't modify anything below this if you don't know what you're doing. */

#if defined ARG_CITY || defined ARG_COUNTRY || defined ARG_COUNTRY_CODE || defined ARG_CONTINENT || defined ARG_CONTINENT_CODE
    #include <geoip>
#endif

#if defined ARG_XP
    
native crxranks_get_user_xp(id)
#endif

#if defined ARG_NEXT_XP
    
native crxranks_get_user_next_xp(id)
#endif

#if defined ARG_NEXT_LEVEL
    
native crxranks_get_user_next_level(id)
#endif

#if defined ARG_RANK
    
native crxranks_get_user_rank(idbuffer[], len)
#endif

#if defined ARG_NEXT_RANK
    
native crxranks_get_user_next_rank(idbuffer[], len)
#endif

native crxranks_get_user_level(id)
forward crxranks_user_level_updated(idlevelbool:levelup)

enum
{
    
SECTION_NONE,
    
SECTION_MAIN_SETTINGS,
    
SECTION_ADMIN_PREFIXES,
    
SECTION_CHAT_COLORS,
    
SECTION_NAME_CUSTOMIZATION,
    
SECTION_FORMAT_DEFINITIONS,
    
SECTION_SAY_FORMATS
}

enum
{
    
INFOTYPE_NONE,
    
INFOTYPE_FLAG,
    
INFOTYPE_NAME,
    
INFOTYPE_IP,
    
INFOTYPE_STEAM,
    
INFOTYPE_ANY_FLAG,
    
INFOTYPE_NO_PREFIX,
    
INFOTYPE_LEVEL
}

enum
{
    
ALLCHAT_NONE 0,
    
ALLCHAT_NO_TEAM,
    
ALLCHAT_SEE_TEAM
}

enum
{
    
EDB_IGNORE 0,
    
EDB_COMMENT,
    
EDB_REMOVE
}

enum _:PlayerInfo
{
    
INFO_TYPE,
    
INFO[35],
    
DATA[32],
    
DATA2[32],
    
EXPIRATION_DATE[32]
}

enum _:Settings
{
    
ALL_CHAT,
    
ADMIN_LISTEN_FLAGS[32],
    
DEAD_PREFIX[32],
    
ALIVE_PREFIX[32],
    
SPEC_PREFIX[32],
    
TEAM_PREFIX_T[32],
    
TEAM_PREFIX_CT[32],
    
TEAM_PREFIX_SPEC[32],
    
ERROR_TEXT[32],
    
FORMAT_TIME[32],
    
CHAT_LOG_FILE[64],
    
CHAT_LOG_SAY_FORMAT[32],
    
CHAT_LOG_TEAM_FORMAT[32],
    
SAY_SOUND[128],
    
SAY_TEAM_SOUND[128],
    
EXPIRATION_DATE_FORMAT[32],
    
EXPIRATION_DATE_BEHAVIOR
}

enum _:PlayerData
{
    
PDATA_NAME[32],
    
PDATA_CUSTOM_NAME[32],
    
PDATA_IP[16],
    
PDATA_STEAM[35],
    
PDATA_USERID[10],
    
PDATA_PREFIX[32],
    
PDATA_CHAT_COLOR[6],
    
PDATA_SAY_FORMAT[32],
    
PDATA_SAY_TEAM_FORMAT[32],
    
PDATA_ADMIN_FLAGS,
    
bool:PDATA_ADMIN_LISTEN,
    
bool:PDATA_PREFIX_ENABLED,
    
bool:PDATA_CHAT_COLOR_ENABLED,
    
bool:PDATA_CUSTOM_NAME_ENABLED
}

new 
g_eSettings[Settings],
    
g_ePlayerData[33][PlayerData],
    Array:
g_aAdminPrefixes,
    Array:
g_aChatColors,
    Array:
g_aNameCustomization,
    Array:
g_aSayFormats,
    Array:
g_aFileContents,
    
Trie:g_tBlockFirst,
    
Trie:g_tFormatDefinitions,
    
bool:g_bFileWasRead,
    
bool:g_bRankSystem,
    
bool:g_bSomethingExpired,
    
g_szConfigsName[256],
    
g_szFilename[256],
    
g_iAdminPrefixes,
    
g_iChatColors,
    
g_iNameCustomization,
    
g_iSayFormats,
    
g_iFileContents = -1,
    
g_iToday

public plugin_init()
{
    
register_plugin("Chat Manager"PLUGIN_VERSION"OciXCrom")
    
register_cvar("CRXChatManager"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
    
set_task(DELAY_ON_REGISTER"RegisterCommands")
}

public 
plugin_end()
{
    
ArrayDestroy(g_aAdminPrefixes)
    
ArrayDestroy(g_aChatColors)
    
ArrayDestroy(g_aNameCustomization)
    
ArrayDestroy(g_aSayFormats)
    
ArrayDestroy(g_aFileContents)
    
TrieDestroy(g_tBlockFirst)
    
TrieDestroy(g_tFormatDefinitions)
}

public 
plugin_precache()
{
    
g_aAdminPrefixes ArrayCreate(PlayerInfo)
    
g_aChatColors ArrayCreate(PlayerInfo)
    
g_aNameCustomization ArrayCreate(PlayerInfo)
    
g_aSayFormats ArrayCreate(PlayerInfo)
    
g_aFileContents ArrayCreate(192)
    
g_tBlockFirst TrieCreate()
    
g_tFormatDefinitions TrieCreate()
    
get_configsdir(g_szConfigsNamecharsmax(g_szConfigsName))
    
formatex(g_szFilenamecharsmax(g_szFilename), "%s/ChatManager.ini"g_szConfigsName)

    if(
LibraryExists("crxranks"LibType_Library))
    {
        
g_bRankSystem true
    
}

    
ReadFile()
}

public 
RegisterCommands()
{
    
register_clcmd("say""Hook_Say")
    
register_clcmd("say_team""Hook_Say")
    
register_concmd("cm_reload""Cmd_Reload"ADMIN_RCON"-- reloads the configuration file")
}

public 
client_putinserver(id)
{
    
get_user_name(idg_ePlayerData[id][PDATA_NAME], charsmax(g_ePlayerData[][PDATA_NAME]))
    
copy(g_ePlayerData[id][PDATA_CUSTOM_NAME], charsmax(g_ePlayerData[][PDATA_CUSTOM_NAME]), g_ePlayerData[id][PDATA_NAME])
    
get_user_ip(idg_ePlayerData[id][PDATA_IP], charsmax(g_ePlayerData[][PDATA_IP]), 1)
    
get_user_authid(idg_ePlayerData[id][PDATA_STEAM], charsmax(g_ePlayerData[][PDATA_STEAM]))
    
num_to_str(get_user_userid(id), g_ePlayerData[id][PDATA_USERID], charsmax(g_ePlayerData[][PDATA_USERID]))
    
g_ePlayerData[id][PDATA_PREFIX_ENABLED] = true
    g_ePlayerData
[id][PDATA_CHAT_COLOR_ENABLED] = true
    g_ePlayerData
[id][PDATA_CUSTOM_NAME_ENABLED] = true
    set_task
(DELAY_ON_CONNECT"UpdateData"id)
}

public 
client_infochanged(id)
{
    if(!
is_user_connected(id))
    {
        return
    }

    static 
szNewName[32]
    
get_user_info(id"name"szNewNamecharsmax(szNewName))

    if(!
equal(szNewNameg_ePlayerData[id][PDATA_NAME]))
    {
        
copy(g_ePlayerData[id][PDATA_NAME], charsmax(g_ePlayerData[][PDATA_NAME]), szNewName)
        
copy(g_ePlayerData[id][PDATA_CUSTOM_NAME], charsmax(g_ePlayerData[][PDATA_CUSTOM_NAME]), szNewName)
        
set_task(DELAY_ON_CHANGE"UpdateData"id)
    }
}

public 
crxranks_user_level_updated(idiLevel)
{
    
set_task(DELAY_ON_CHANGE"UpdateData"id)
}

public 
UpdateData(id)
{
    static 
eItem[PlayerInfo], i
    g_ePlayerData
[id][PDATA_PREFIX][0] = EOS
    g_ePlayerData
[id][PDATA_CHAT_COLOR][0] = EOS
    g_ePlayerData
[id][PDATA_SAY_FORMAT][0] = EOS
    g_ePlayerData
[id][PDATA_SAY_TEAM_FORMAT][0] = EOS
    g_ePlayerData
[id][PDATA_ADMIN_FLAGS] = get_user_flags(id)
    
g_ePlayerData[id][PDATA_ADMIN_LISTEN] = g_eSettings[ADMIN_LISTEN_FLAGS][0] ? (bool:(g_ePlayerData[id][PDATA_ADMIN_FLAGS] & read_flags(g_eSettings[ADMIN_LISTEN_FLAGS])) ? true false) : false
    copy
(g_ePlayerData[id][PDATA_CUSTOM_NAME], charsmax(g_ePlayerData[][PDATA_CUSTOM_NAME]), g_ePlayerData[id][PDATA_NAME])

    if(
g_iAdminPrefixes)
    {
        for(
0g_iAdminPrefixesi++)
        {
            
ArrayGetArray(g_aAdminPrefixesieItem)

            if(
meets_requirements(ideItem[INFO_TYPE], eItem[INFO]))
            {
                
copy(g_ePlayerData[id][PDATA_PREFIX], charsmax(g_ePlayerData[][PDATA_PREFIX]), eItem[DATA])
                break
            }
        }
    }

    if(
g_iChatColors)
    {
        for(
0g_iChatColorsi++)
        {
            
ArrayGetArray(g_aChatColorsieItem)

            if(
meets_requirements(ideItem[INFO_TYPE], eItem[INFO]))
            {
                
copy(g_ePlayerData[id][PDATA_CHAT_COLOR], charsmax(g_ePlayerData[][PDATA_CHAT_COLOR]), eItem[DATA])
                break
            }
        }
    }

    if(
g_iNameCustomization)
    {
        for(
0g_iNameCustomizationi++)
        {
            
ArrayGetArray(g_aNameCustomizationieItem)

            if(
meets_requirements(ideItem[INFO_TYPE], eItem[INFO]))
            {
                
copy(g_ePlayerData[id][PDATA_CUSTOM_NAME], charsmax(g_ePlayerData[][PDATA_CUSTOM_NAME]), eItem[DATA])
                break
            }
        }
    }

    if(
g_iSayFormats)
    {
        for(
0g_iSayFormatsi++)
        {
            
ArrayGetArray(g_aSayFormatsieItem)

            if(
meets_requirements(ideItem[INFO_TYPE], eItem[INFO]))
            {
                
copy(g_ePlayerData[id][PDATA_SAY_FORMAT], charsmax(g_ePlayerData[][PDATA_SAY_FORMAT]), eItem[DATA])
                
copy(g_ePlayerData[id][PDATA_SAY_TEAM_FORMAT], charsmax(g_ePlayerData[][PDATA_SAY_TEAM_FORMAT]), eItem[DATA2])
                break
            }
        }
    }
}

ReadFile()
{
    if(
g_bFileWasRead)
    {
        
g_iAdminPrefixes 0
        g_iChatColors 
0
        g_iNameCustomization 
0
        g_iSayFormats 
0
        g_iFileContents 
= -1
        g_bSomethingExpired 
false
        ArrayClear
(g_aAdminPrefixes)
        
ArrayClear(g_aChatColors)
        
ArrayClear(g_aNameCustomization)
        
ArrayClear(g_aSayFormats)
        
ArrayClear(g_aFileContents)
        
TrieClear(g_tBlockFirst)
        
TrieClear(g_tFormatDefinitions)
    }

    new 
iFilePointer fopen(g_szFilename"rt")

    if(
iFilePointer)
    {
        new 
szData[192], szValue[160], szKey[32], eItem[PlayerInfo], iSection SECTION_NONEiChatLogSayLineiChatLogTeamLineiSizeiLine

        
while(!feof(iFilePointer))
        {
            
iLine++
            
fgets(iFilePointerszDatacharsmax(szData))
            
trim(szData)

            
g_iFileContents++
            
ArrayPushString(g_aFileContentsszData)

            switch(
szData[0])
            {
                case 
EOS'#'';':
                {
                    continue
                }
                case 
'[':
                {
                    
iSize strlen(szData)

                    if(
szData[iSize 1] == ']')
                    {
                        switch(
szData[1])
                        {
                            case 
'M''m'iSection SECTION_MAIN_SETTINGS
                            
case 'A''a'iSection SECTION_ADMIN_PREFIXES
                            
case 'C''c'iSection SECTION_CHAT_COLORS
                            
case 'N''n'iSection SECTION_NAME_CUSTOMIZATION
                            
case 'F''f'iSection SECTION_FORMAT_DEFINITIONS
                            
case 'S''s'iSection SECTION_SAY_FORMATS
                            
default:
                            {
                                
log_config_error(iLine"Unknown section name: %s"szData)
                                
iSection SECTION_NONE
                            
}
                        }
                    }
                    else
                    {
                        
log_config_error(iLine"Unclosed section name: %s"szData)
                        continue
                    }
                }
                default:
                {
                    switch(
iSection)
                    {
                        case 
SECTION_NONElog_config_error(iLine"Data is not in any section: %s"szData)
                        case 
SECTION_MAIN_SETTINGS:
                        {
                            
strtok(szDataszKeycharsmax(szKey), szValuecharsmax(szValue), '=')
                            
trim(szKey); trim(szValue)

                            if(!
szValue[0])
                            {
                                continue
                            }

                            if(
equal(szKey"ALL_CHAT"))
                            {
                                
g_eSettings[ALL_CHAT] = clamp(str_to_num(szValue), ALLCHAT_NONEALLCHAT_SEE_TEAM)
                            }
                            else if(
equal(szKey"ADMIN_LISTEN_FLAGS"))
                            {
                                
copy(g_eSettings[ADMIN_LISTEN_FLAGS], charsmax(g_eSettings[ADMIN_LISTEN_FLAGS]), szValue)
                            }
                            else if(
equal(szKey"BLOCK_FIRST_SYMBOLS"))
                            {
                                while(
szValue[0] != && strtok(szValueszKeycharsmax(szKey), szValuecharsmax(szValue), ','))
                                {
                                    
trim(szKey); trim(szValue)
                                    
TrieSetCell(g_tBlockFirstszKey1)
                                }
                            }
                            else if(
equal(szKey"DEAD_PREFIX"))
                            {
                                
copy(g_eSettings[DEAD_PREFIX], charsmax(g_eSettings[DEAD_PREFIX]), szValue)
                            }
                            else if(
equal(szKey"ALIVE_PREFIX"))
                            {
                                
copy(g_eSettings[ALIVE_PREFIX], charsmax(g_eSettings[ALIVE_PREFIX]), szValue)
                            }
                            else if(
equal(szKey"SPEC_PREFIX"))
                            {
                                
copy(g_eSettings[SPEC_PREFIX], charsmax(g_eSettings[SPEC_PREFIX]), szValue)
                            }
                            else if(
equal(szKey"TEAM_PREFIX_T"))
                            {
                                
copy(g_eSettings[TEAM_PREFIX_T], charsmax(g_eSettings[TEAM_PREFIX_T]), szValue)
                            }
                            else if(
equal(szKey"TEAM_PREFIX_CT"))
                            {
                                
copy(g_eSettings[TEAM_PREFIX_CT], charsmax(g_eSettings[TEAM_PREFIX_CT]), szValue)
                            }
                            else if(
equal(szKey"TEAM_PREFIX_SPEC"))
                            {
                                
copy(g_eSettings[TEAM_PREFIX_SPEC], charsmax(g_eSettings[TEAM_PREFIX_SPEC]), szValue)
                            }
                            else if(
equal(szKey"ERROR_TEXT"))
                            {
                                
copy(g_eSettings[ERROR_TEXT], charsmax(g_eSettings[ERROR_TEXT]), szValue)
                            }
                            else if(
equal(szKey"FORMAT_TIME"))
                            {
                                
copy(g_eSettings[FORMAT_TIME], charsmax(g_eSettings[FORMAT_TIME]), szValue)
                            }
                            else if(
equal(szKey"CHAT_LOG_FILE"))
                            {
                                
copy(g_eSettings[CHAT_LOG_FILE], charsmax(g_eSettings[CHAT_LOG_FILE]), szValue)
                            }
                            else if(
equal(szKey"CHAT_LOG_SAY_FORMAT"))
                            {
                                
iChatLogSayLine iLine
                                copy
(g_eSettings[CHAT_LOG_SAY_FORMAT], charsmax(g_eSettings[CHAT_LOG_SAY_FORMAT]), szValue)
                            }
                            else if(
equal(szKey"CHAT_LOG_TEAM_FORMAT"))
                            {
                                
iChatLogTeamLine iLine
                                copy
(g_eSettings[CHAT_LOG_TEAM_FORMAT], charsmax(g_eSettings[CHAT_LOG_TEAM_FORMAT]), szValue)
                            }
                            else if(
equal(szKey"SAY_SOUND") && !g_bFileWasRead)
                            {
                                
precache_sound(szValue)
                                
copy(g_eSettings[SAY_SOUND], charsmax(g_eSettings[SAY_SOUND]), szValue)
                            }
                            else if(
equal(szKey"SAY_TEAM_SOUND") && !g_bFileWasRead)
                            {
                                
precache_sound(szValue)
                                
copy(g_eSettings[SAY_TEAM_SOUND], charsmax(g_eSettings[SAY_TEAM_SOUND]), szValue)
                            }
                            else if(
equal(szKey"EXPIRATION_DATE_FORMAT"))
                            {
                                
g_iToday get_systime()
                                
copy(g_eSettings[EXPIRATION_DATE_FORMAT], charsmax(g_eSettings[EXPIRATION_DATE_FORMAT]), szValue)
                            }
                            else if(
equal(szKey"EXPIRATION_DATE_BEHAVIOR"))
                            {
                                
g_eSettings[EXPIRATION_DATE_BEHAVIOR] = clamp(str_to_num(szValue), EDB_IGNOREEDB_REMOVE)
                            }
                        }
                        case 
SECTION_FORMAT_DEFINITIONS:
                        {
                            
strtok(szDataszKeycharsmax(szKey), szValuecharsmax(szValue), '=')
                            
trim(szKey); trim(szValue)
                            
TrieSetString(g_tFormatDefinitionsszKeyszValue)
                        }
                        case 
SECTION_ADMIN_PREFIXES:
                        {
                            
eItem[EXPIRATION_DATE][0] = EOS
                            parse
(szDataszKeycharsmax(szKey), eItem[INFO], charsmax(eItem[INFO]), eItem[DATA], charsmax(eItem[DATA]), eItem[EXPIRATION_DATE], charsmax(eItem[EXPIRATION_DATE]))

                            if(
is_date_expired(eItem[EXPIRATION_DATE], iLine))
                            {
                                continue
                            }

                            
eItem[INFO_TYPE] = get_info_type(szKey)

                            if(
invalid_info_type(eItem[INFO_TYPE], szKeyiLine))
                            {
                                continue
                            }

                            
ArrayPushArray(g_aAdminPrefixeseItem)
                            
g_iAdminPrefixes++
                        }
                        case 
SECTION_CHAT_COLORS:
                        {
                            
eItem[EXPIRATION_DATE][0] = EOS
                            parse
(szDataszKeycharsmax(szKey), eItem[INFO], charsmax(eItem[INFO]), eItem[DATA], charsmax(eItem[DATA]), eItem[EXPIRATION_DATE], charsmax(eItem[EXPIRATION_DATE]))

                            if(
is_date_expired(eItem[EXPIRATION_DATE], iLine))
                            {
                                continue
                            }

                            
eItem[INFO_TYPE] = get_info_type(szKey)

                            if(
invalid_info_type(eItem[INFO_TYPE], szKeyiLine))
                            {
                                continue
                            }

                            
ArrayPushArray(g_aChatColorseItem)
                            
g_iChatColors++
                        }
                        case 
SECTION_NAME_CUSTOMIZATION:
                        {
                            
eItem[EXPIRATION_DATE][0] = EOS
                            parse
(szDataszKeycharsmax(szKey), eItem[INFO], charsmax(eItem[INFO]), eItem[DATA], charsmax(eItem[DATA]), eItem[EXPIRATION_DATE], charsmax(eItem[EXPIRATION_DATE]))

                            if(
is_date_expired(eItem[EXPIRATION_DATE], iLine))
                            {
                                continue
                            }

                            
eItem[INFO_TYPE] = get_info_type(szKey)

                            if(
invalid_info_type(eItem[INFO_TYPE], szKeyiLine))
                            {
                                continue
                            }

                            
ArrayPushArray(g_aNameCustomizationeItem)
                            
g_iNameCustomization++
                        }
                        case 
SECTION_SAY_FORMATS:
                        {
                            
eItem[EXPIRATION_DATE][0] = EOS
                            parse
(szDataszKeycharsmax(szKey), eItem[INFO], charsmax(eItem[INFO]), eItem[DATA], charsmax(eItem[DATA]), eItem[DATA2], charsmax(eItem[DATA2]), eItem[EXPIRATION_DATE], charsmax(eItem[EXPIRATION_DATE]))

                            if(
is_date_expired(eItem[EXPIRATION_DATE], iLine))
                            {
                                continue
                            }

                            if(!
TrieKeyExists(g_tFormatDefinitionseItem[DATA]))
                            {
                                
log_config_error(iLine"Format definition ^"%s^" doesn't exist."eItem[DATA])
                                continue
                            }

                            if(!
TrieKeyExists(g_tFormatDefinitionseItem[DATA2]))
                            {
                                
log_config_error(iLine"Format definition ^"%s^" doesn't exist."eItem[DATA2])
                                continue
                            }

                            
eItem[INFO_TYPE] = get_info_type(szKey)

                            if(
invalid_info_type(eItem[INFO_TYPE], szKeyiLine))
                            {
                                continue
                            }

                            
ArrayPushArray(g_aSayFormatseItem)
                            
g_iSayFormats++
                        }
                    }
                }
            }
        }

        
fclose(iFilePointer)

        if(
g_eSettings[CHAT_LOG_FILE][0])
        {
            if(!
TrieKeyExists(g_tFormatDefinitionsg_eSettings[CHAT_LOG_SAY_FORMAT]))
            {
                
g_eSettings[CHAT_LOG_FILE][0] = EOS
                format_doesnt_exist
(iChatLogSayLineg_eSettings[CHAT_LOG_SAY_FORMAT])
            }

            if(!
TrieKeyExists(g_tFormatDefinitionsg_eSettings[CHAT_LOG_TEAM_FORMAT]))
            {
                
g_eSettings[CHAT_LOG_FILE][0] = EOS
                format_doesnt_exist
(iChatLogTeamLineg_eSettings[CHAT_LOG_TEAM_FORMAT])
            }
        }

        if(
g_bFileWasRead)
        {
            new 
iPlayers[32], iPnum
            get_players
(iPlayersiPnum)

            for(new 
iiPnumi++)
            {
                
UpdateData(iPlayers[i])
            }
        }

        
g_bFileWasRead true

        
if(g_bSomethingExpired && g_eSettings[EXPIRATION_DATE_BEHAVIOR] != EDB_IGNORE)
        {
            
iFilePointer fopen(g_szFilename"w")

            for(new 
ig_iFileContents 1i++)
            {
                
fprintf(iFilePointer"%a"ArrayGetStringHandle(g_aFileContentsi))

                if(
g_iFileContents)
                {
                    
fprintf(iFilePointer"^n")
                }
            }

            
fclose(iFilePointer)
        }
    }
}

public 
Cmd_Reload(idiLeveliCid)
{
    if(!
cmd_access(idiLeveliCid1))
    {
        return 
PLUGIN_HANDLED
    
}

    
ReadFile()
    
console_print(id"Reload successful!")

    if(
is_user_connected(id))
    {
        
log_amx("%s [ %s | %s ] has reloaded the configuration file."g_ePlayerData[id][PDATA_NAME], g_ePlayerData[id][PDATA_IP], g_ePlayerData[id][PDATA_STEAM])
    }

    return 
PLUGIN_HANDLED
}

public 
Hook_Say(id)
{
    if(!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}

    static 
szArgs[WRITTEN_MESSAGE_SIZE]
    
read_args(szArgscharsmax(szArgs)); remove_quotes(szArgs)
    
CC_RemoveColors(szArgscharsmax(szArgs))

    static 
szFirstChar[2]
    
szFirstChar[0] = szArgs[0]

    if(!
szArgs[0] || TrieKeyExists(g_tBlockFirstszFirstChar))
    {
        return 
PLUGIN_HANDLED
    
}

    static 
iFlags
    iFlags 
get_user_flags(id)

    if(
g_ePlayerData[id][PDATA_ADMIN_FLAGS] != iFlags)
    {
        
UpdateData(id)
        
g_ePlayerData[id][PDATA_ADMIN_FLAGS] = iFlags
    
}

    static 
szCommand[5]
    
read_argv(0szCommandcharsmax(szCommand))

    static 
szMessage[FULL_MESSAGE_SIZE 32], szSound[128], iPlayers[32], iPnumbool:bTeamiAliveCsTeams:iTeam
    bTeam 
szCommand[3] == '_'
    
iAlive is_user_alive(id)
    
iTeam cs_get_user_team(id)

    if(
bTeam && g_eSettings[SAY_TEAM_SOUND][0])
    {
        
copy(szSoundcharsmax(szSound), g_eSettings[SAY_TEAM_SOUND])
    }
    else if(!
bTeam && g_eSettings[SAY_SOUND][0])
    {
        
copy(szSoundcharsmax(szSound), g_eSettings[SAY_SOUND])
    }
    else
    {
        
szSound[0] = EOS
    
}

    
apply_replacements(g_ePlayerData[id][bTeam PDATA_SAY_TEAM_FORMAT PDATA_SAY_FORMAT], idiAliveiTeamszArgsszMessagecharsmax(szMessage))
    
get_players(iPlayersiPnum"ch")

    if(
g_eSettings[ALL_CHAT] == ALLCHAT_SEE_TEAM)
    {
        
CC_SendMatched(0idszMessage)

        if(
szSound[0])
        {
            
client_cmd(0"spk ^"%s^""szSound)
        }
    }
    else
    {
        static 
iPlayeri

        
for(0iPnumi++)
        {
            
iPlayer iPlayers[i]

            if(
g_ePlayerData[iPlayer][PDATA_ADMIN_LISTEN] || (bTeam && iTeam == cs_get_user_team(iPlayer) && iAlive == is_user_alive(iPlayer)) || (!bTeam && (g_eSettings[ALL_CHAT] == || iAlive == is_user_alive(iPlayer))))
            {
                
CC_SendMatched(iPlayeridszMessage)

                if(
szSound[0])
                {
                    
client_cmd(iPlayer"spk ^"%s^""szSound)
                }
            }
        }
    }

    if(
g_eSettings[CHAT_LOG_FILE][0])
    {
        
apply_replacements(g_eSettings[bTeam CHAT_LOG_TEAM_FORMAT CHAT_LOG_SAY_FORMAT], idiAliveiTeamszArgsszMessagecharsmax(szMessage))
        
log_to_file(g_eSettings[CHAT_LOG_FILE], szMessage)
    }

    return 
PLUGIN_HANDLED
}

apply_replacements(const szFormat[], const id, const iAlive, const CsTeams:iTeam, const szArgs[], szMessage[], const iLen)
{
    static 
szPlaceHolder[PLACEHOLDER_LENGTH]
    
TrieGetString(g_tFormatDefinitionsszFormatszMessageiLen)

    
#if defined ARG_ADMIN_PREFIX
    
if(g_ePlayerData[id][PDATA_PREFIX_ENABLED])
    {
        
replace_all(szMessageiLenARG_ADMIN_PREFIXg_ePlayerData[id][PDATA_PREFIX])
    }
    else
    {
        
replace_all(szMessageiLenARG_ADMIN_PREFIX"")
    }
    
#endif

    #if defined ARG_DEAD_PREFIX
    
replace_all(szMessageiLenARG_DEAD_PREFIXg_eSettings[iAlive ALIVE_PREFIX iTeam == CS_TEAM_SPECTATOR SPEC_PREFIX DEAD_PREFIX])
    
#endif

    #if defined ARG_TEAM
    
replace_all(szMessageiLenARG_TEAMg_eSettings[iTeam == CS_TEAM_CT TEAM_PREFIX_CT iTeam == CS_TEAM_T TEAM_PREFIX_T TEAM_PREFIX_SPEC])
    
#endif

    #if defined ARG_NAME
    
replace_all(szMessageiLenARG_NAMEg_ePlayerData[id][PDATA_NAME])
    
#endif

    #if defined ARG_CUSTOM_NAME
    
replace_all(szMessageiLenARG_CUSTOM_NAMEg_ePlayerData[id][g_ePlayerData[id][PDATA_CUSTOM_NAME_ENABLED] ? PDATA_CUSTOM_NAME PDATA_NAME])
    
#endif

    #if defined ARG_IP
    
replace_all(szMessageiLenARG_IPg_ePlayerData[id][PDATA_IP])
    
#endif

    #if defined ARG_STEAM
    
replace_all(szMessageiLenARG_STEAMg_ePlayerData[id][PDATA_STEAM])
    
#endif

    #if defined ARG_USERID
    
replace_all(szMessageiLenARG_USERIDg_ePlayerData[id][PDATA_USERID])
    
#endif

    #if defined ARG_CHAT_COLOR
    
if(g_ePlayerData[id][PDATA_CHAT_COLOR_ENABLED])
    {
        
replace_all(szMessageiLenARG_CHAT_COLORg_ePlayerData[id][PDATA_CHAT_COLOR])
    }
    else
    {
        
replace_all(szMessageiLenARG_CHAT_COLOR"")
    }
    
#endif

    #if defined ARG_TIME
    
if(has_argument(szMessageARG_TIME))
    {
        
get_time(g_eSettings[FORMAT_TIME], szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_TIMEszPlaceHolder)
    }
    
#endif

    #if defined ARG_CURRENT_XP
    
if(g_bRankSystem && has_argument(szMessageARG_CURRENT_XP))
    {
        
num_to_str(crxranks_get_user_xp(id), szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_CURRENT_XPszPlaceHolder)
    }
    
#endif

    #if defined ARG_NEXT_XP
    
if(g_bRankSystem && has_argument(szMessageARG_NEXT_XP))
    {
        
num_to_str(crxranks_get_user_next_xp(id), szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_NEXT_XPszPlaceHolder)
    }
    
#endif

    #if defined ARG_LEVEL
    
if(g_bRankSystem && has_argument(szMessageARG_LEVEL))
    {
        
num_to_str(crxranks_get_user_level(id), szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_LEVELszPlaceHolder)
    }
    
#endif

    #if defined ARG_NEXT_LEVEL
    
if(g_bRankSystem && has_argument(szMessageARG_NEXT_LEVEL))
    {
        
num_to_str(crxranks_get_user_next_level(id), szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_NEXT_LEVELszPlaceHolder)
    }
    
#endif

    #if defined ARG_RANK
    
if(g_bRankSystem && has_argument(szMessageARG_RANK))
    {
        
crxranks_get_user_rank(idszPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_RANKszPlaceHolder)
    }
    
#endif

    #if defined ARG_NEXT_RANK
    
if(g_bRankSystem && has_argument(szMessageARG_NEXT_RANK))
    {
        
crxranks_get_user_next_rank(idszPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_NEXT_RANKszPlaceHolder)
    }
    
#endif

    #if defined ARG_HEALTH
    
if(has_argument(szMessageARG_HEALTH))
    {
        
num_to_str(iAlive get_user_health(id) : 0szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_HEALTHszPlaceHolder)
    }
    
#endif

    #if defined ARG_ARMOR
    
if(has_argument(szMessageARG_ARMOR))
    {
        
num_to_str(iAlive get_user_armor(id) : 0szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_ARMORszPlaceHolder)
    }
    
#endif

    #if defined ARG_FRAGS
    
if(has_argument(szMessageARG_FRAGS))
    {
        
num_to_str(get_user_frags(id), szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_FRAGSszPlaceHolder)
    }
    
#endif

    #if defined ARG_DEATHS
    
if(has_argument(szMessageARG_DEATHS))
    {
        
num_to_str(cs_get_user_deaths(id), szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_DEATHSszPlaceHolder)
    }
    
#endif

    #if defined ARG_CITY
    
if(has_argument(szMessageARG_CITY))
    {
        
geoip_city(g_ePlayerData[id][PDATA_IP], szPlaceHoldercharsmax(szPlaceHolder))
        
check_validity(szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_CITYszPlaceHolder)
    }
    
#endif

    #if defined ARG_COUNTRY
    
if(has_argument(szMessageARG_COUNTRY))
    {
        
#if defined geoip_country_ex
        
geoip_country_ex(g_ePlayerData[id][PDATA_IP], szPlaceHoldercharsmax(szPlaceHolder))
        
#else
        
geoip_country(g_ePlayerData[id][PDATA_IP], szPlaceHoldercharsmax(szPlaceHolder))
        
#endif

        
check_validity(szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_COUNTRYszPlaceHolder)
    }
    
#endif

    #if defined ARG_COUNTRY_CODE
    
if(has_argument(szMessageARG_COUNTRY_CODE))
    {
        new 
szCountryCode[3]

        
#if defined geoip_code2_ex
        
geoip_code2_ex(g_ePlayerData[id][PDATA_IP], szCountryCode)
        
#else
        
geoip_code2(g_ePlayerData[id][PDATA_IP], szCountryCode)
        
#endif

        
check_validity(szCountryCodecharsmax(szCountryCode))
        
replace_all(szMessageiLenARG_COUNTRY_CODEszCountryCode)
    }
    
#endif

    #if defined ARG_CONTINENT
    
if(has_argument(szMessageARG_CONTINENT))
    {
        
geoip_continent_name(g_ePlayerData[id][PDATA_IP], szPlaceHoldercharsmax(szPlaceHolder))
        
check_validity(szPlaceHoldercharsmax(szPlaceHolder))
        
replace_all(szMessageiLenARG_CONTINENTszPlaceHolder)
    }
    
#endif

    #if defined ARG_CONTINENT_CODE
    
if(has_argument(szMessageARG_CONTINENT_CODE))
    {
        new 
szContinentCode[3]
        
geoip_continent_code(g_ePlayerData[id][PDATA_IP], szContinentCode)
        
check_validity(szContinentCodecharsmax(szContinentCode))
        
replace_all(szMessageiLenARG_CONTINENT_CODEszContinentCode)
    }
    
#endif

    
replace_all(szMessageiLen"  "" ")

    
#if defined ARG_MESSAGE
    
replace_all(szMessageiLenARG_MESSAGEszArgs)
    
#endif

    
trim(szMessage)
}

stock bool:has_argument(const szMessage[], const szArgument[])
{
    return 
contain(szMessageszArgument) != -1
}

stock check_validity(szText[], const iLen)
{
    if(!
szText[0])
    {
        
copy(szTextiLeng_eSettings[ERROR_TEXT])
    }
}

bool:is_date_expired(const szDate[], const iLine)
{
    if(!
szDate[0])
    {
        return 
false
    
}

    if(!
g_eSettings[EXPIRATION_DATE_FORMAT][0])
    {
        
log_config_error(iLine"Can't use expiration dates because EXPIRATION_DATE_FORMAT is not set.")
        return 
false
    
}

    if(
parse_time(szDateg_eSettings[EXPIRATION_DATE_FORMAT]) < g_iToday)
    {
        switch(
g_eSettings[EXPIRATION_DATE_BEHAVIOR])
        {
            case 
EDB_COMMENT:
            {
                static 
szData[192]
                
formatex(szDatacharsmax(szData), "# %a"ArrayGetStringHandle(g_aFileContentsg_iFileContents))
                
ArraySetString(g_aFileContentsg_iFileContentsszData)
            }
            case 
EDB_REMOVE:
            {
                
ArrayDeleteItem(g_aFileContentsg_iFileContents--)
            }
        }

        
g_bSomethingExpired true
        
return true
    
}

    return 
false
}

bool:invalid_info_type(const iInfoType, const szInfoType[], const iLine)
{
    if(
iInfoType == INFOTYPE_NONE)
    {
        
log_config_error(iLine"Invalid info type: %s"szInfoType)
        return 
true
    
}

    if(!
g_bRankSystem && iInfoType == INFOTYPE_LEVEL)
    {
        
log_config_error(iLine"Can't use info type ^"%s^" because OciXCrom's Rank System isn't running."szInfoType)
        return 
true
    
}

    return 
false
}

bool:meets_requirements(const id, const iInfoType, const szInfo[])
{
    switch(
iInfoType)
    {
        case 
INFOTYPE_FLAG:
        {
            static 
iFlags
            iFlags 
read_flags(szInfo)

            if(
g_ePlayerData[id][PDATA_ADMIN_FLAGS] & iFlags == iFlags)
            {
                return 
true
            
}
        }
        case 
INFOTYPE_NAME:
        {
            if(
equali(g_ePlayerData[id][PDATA_NAME], szInfo))
            {
                return 
true
            
}
        }
        case 
INFOTYPE_IP:
        {
            if(
equal(g_ePlayerData[id][PDATA_IP], szInfo))
            {
                return 
true
            
}
        }
        case 
INFOTYPE_STEAM:
        {
            if(
equal(g_ePlayerData[id][PDATA_STEAM], szInfo))
            {
                return 
true
            
}
        }
        case 
INFOTYPE_ANY_FLAG:
        {
            if(
g_ePlayerData[id][PDATA_ADMIN_FLAGS] & read_flags(szInfo))
            {
                return 
true
            
}
        }
        case 
INFOTYPE_NO_PREFIX:
        {
            if(!
g_ePlayerData[id][PDATA_PREFIX][0] || !g_ePlayerData[id][PDATA_PREFIX_ENABLED])
            {
                return 
true
            
}
        }
        case 
INFOTYPE_LEVEL:
        {
            if(
crxranks_get_user_level(id) >= str_to_num(szInfo))
            {
                return 
true
            
}
        }
    }

    return 
false
}

log_config_error(const iLine, const szText[], any:...)
{
    static 
szError[192]
    
vformat(szErrorcharsmax(szError), szText3)
    
log_to_file(ERROR_FILE"Line %i: %s"iLineszError)
}

format_doesnt_exist(const iLine, const szFormat[])
{
    
log_config_error(iLine"Format definition ^"%s^" doesn't exist."szFormat)
}

get_info_type(const szText[])
{
    static 
iInfoType
    iInfoType 
INFOTYPE_NONE

    
switch(szText[0])
    {
        case 
'F''f'iInfoType INFOTYPE_FLAG
        
case 'N''n':
        {
            switch(
szText[1])
            {
                case 
'A''a'iInfoType INFOTYPE_NAME
                
case 'O''o'iInfoType INFOTYPE_NO_PREFIX
            
}
        }
        case 
'I''i'iInfoType INFOTYPE_IP
        
case 'S''s'iInfoType INFOTYPE_STEAM
        
case 'A''a'iInfoType INFOTYPE_ANY_FLAG
        
case 'L''l'iInfoType INFOTYPE_LEVEL
    
}

    return 
iInfoType
}

public 
plugin_natives()
{
    
register_library("chatmanager")
    
register_native("cm_get_admin_listen_flags",         "_cm_get_admin_listen_flags")
    
register_native("cm_get_chat_color_by_num",         "_cm_get_chat_color_by_num")
    
register_native("cm_get_prefix_by_num",             "_cm_get_prefix_by_num")
    
register_native("cm_get_user_chat_color",             "_cm_get_user_chat_color")
    
register_native("cm_get_user_chat_color_status",     "_cm_get_user_chat_color_status")
    
register_native("cm_get_user_custom_name",            "_cm_get_user_custom_name")
    
register_native("cm_get_user_custom_name_status",    "_cm_get_user_custom_name_status")
    
register_native("cm_get_user_prefix",                 "_cm_get_user_prefix")
    
register_native("cm_get_user_prefix_status",         "_cm_get_user_prefix_status")
    
register_native("cm_has_user_admin_listen",         "_cm_has_user_admin_listen")
    
register_native("cm_reload_config_file",             "_cm_reload_config_file")
    
register_native("cm_set_user_chat_color",             "_cm_set_user_chat_color")
    
register_native("cm_set_user_chat_color_status",     "_cm_set_user_chat_color_status")
    
register_native("cm_set_user_custom_name_status",     "_cm_set_user_custom_name_status")
    
register_native("cm_set_user_prefix",                 "_cm_set_user_prefix")
    
register_native("cm_set_user_prefix_status",         "_cm_set_user_prefix_status")
    
register_native("cm_set_user_say_format",             "_cm_set_user_say_format")
    
register_native("cm_total_chat_colors",             "_cm_total_chat_colors")
    
register_native("cm_total_prefixes",                 "_cm_total_chat_colors")
    
register_native("cm_total_say_formats",             "_cm_total_say_formats")
    
register_native("cm_update_player_data",             "_cm_update_player_data")
    
set_native_filter("native_filter")
}

public 
native_filter(const szNative[], idiTrap)
{
    if(!
iTrap)
    {
        if(
equal(szNative"crxranks_get_user_level") || equal(szNative"crxranks_user_level_updated"))
        {
            return 
PLUGIN_HANDLED
        
}

        
#if defined ARG_XP
        
if(equal(szNative"crxranks_get_user_xp"))
        {
            return 
PLUGIN_HANDLED
        
}
        
#endif

        #if defined ARG_NEXT_XP
        
if(equal(szNative"crxranks_get_user_next_xp"))
        {
            return 
PLUGIN_HANDLED
        
}
        
#endif

        #if defined ARG_NEXT_LEVEL
        
if(equal(szNative"crxranks_get_user_next_level"))
        {
            return 
PLUGIN_HANDLED
        
}
        
#endif

        #if defined ARG_RANK
        
if(equal(szNative"crxranks_get_user_rank"))
        {
            return 
PLUGIN_HANDLED
        
}
        
#endif

        #if defined ARG_NEXT_RANK
        
if(equal(szNative"crxranks_get_user_next_rank"))
        {
            return 
PLUGIN_HANDLED
        
}
        
#endif
    
}

    return 
PLUGIN_CONTINUE
}

public 
_cm_get_admin_listen_flags(iPluginiParams)
{
    
set_string(1g_eSettings[ADMIN_LISTEN_FLAGS], get_param(2))
}

public 
_cm_get_chat_color_by_num(iPluginiParams)
{
    new 
iNum get_param(1)

    if(
iNum || iNum >= g_iChatColors)
    {
        return 
0
    
}

    new 
szColor[32]
    
ArrayGetString(g_aChatColorsiNumszColorcharsmax(szColor))
    
set_string(2szColorget_param(3))
    return 
1
}

public 
_cm_get_prefix_by_num(iPluginiParams)
{
    new 
iNum get_param(1)

    if(
iNum || iNum >= g_iAdminPrefixes)
    {
        return 
0
    
}

    new 
szPrefix[32]
    
ArrayGetString(g_aAdminPrefixesiNumszPrefixcharsmax(szPrefix))
    
set_string(2szPrefixget_param(3))
    return 
1
}

public 
_cm_get_user_chat_color(iPluginiParams)
{
    
set_string(2g_ePlayerData[get_param(1)][PDATA_CHAT_COLOR], get_param(3))
}

public 
bool:_cm_get_user_chat_color_status(iPluginiParams)
{
    return 
g_ePlayerData[get_param(1)][PDATA_CHAT_COLOR_ENABLED]
}

public 
_cm_get_user_custom_name(iPluginiParams)
{
    
set_string(2g_ePlayerData[get_param(1)][PDATA_CUSTOM_NAME], get_param(3))
}

public 
bool:_cm_get_user_custom_name_status(iPluginiParams)
{
    return 
g_ePlayerData[get_param(1)][PDATA_CUSTOM_NAME_ENABLED]
}

public 
_cm_get_user_prefix(iPluginiParams)
{
    
set_string(2g_ePlayerData[get_param(1)][PDATA_PREFIX], get_param(3))
}

public 
bool:_cm_get_user_prefix_status(iPluginiParams)
{
    return 
g_ePlayerData[get_param(1)][PDATA_PREFIX_ENABLED]
}

public 
bool:_cm_has_user_admin_listen(iPluginiParams)
{
    return 
g_ePlayerData[get_param(1)][PDATA_ADMIN_LISTEN]
}

public 
_cm_reload_config_file(iPluginiParams)
{
    
ReadFile()
}

public 
_cm_set_user_chat_color(iPluginiParams)
{
    
get_string(2g_ePlayerData[get_param(1)][PDATA_CHAT_COLOR], charsmax(g_ePlayerData[][PDATA_CHAT_COLOR]))
}

public 
_cm_set_user_chat_color_status(iPluginiParams)
{
    
g_ePlayerData[get_param(1)][PDATA_CHAT_COLOR_ENABLED] = _:get_param(2)
}

public 
_cm_set_user_custom_name_status(iPluginiParams)
{
    
g_ePlayerData[get_param(1)][PDATA_CUSTOM_NAME_ENABLED] = _:get_param(2)
}

public 
_cm_set_user_prefix(iPluginiParams)
{
    
get_string(2g_ePlayerData[get_param(1)][PDATA_PREFIX], charsmax(g_ePlayerData[][PDATA_PREFIX]))
}

public 
_cm_set_user_prefix_status(iPluginiParams)
{
    static 
idid get_param(1)
    
g_ePlayerData[id][PDATA_PREFIX_ENABLED] = _:get_param(2)

    if(
get_param(3))
    {
        
UpdateData(id)
    }
}

public 
_cm_set_user_say_format(iPluginiParams)
{
    static 
szFormat[32], id
    id 
get_param(1)

    
get_string(2szFormatcharsmax(szFormat))

    if(
TrieKeyExists(g_tFormatDefinitionsszFormat))
    {
        
copy(g_ePlayerData[id][PDATA_SAY_FORMAT], charsmax(g_ePlayerData[][PDATA_SAY_FORMAT]), szFormat)
    }
    else
    {
        return 
0
    
}

    
get_string(3szFormatcharsmax(szFormat))

    if(
TrieKeyExists(g_tFormatDefinitionsszFormat))
    {
        
copy(g_ePlayerData[id][PDATA_SAY_TEAM_FORMAT], charsmax(g_ePlayerData[][PDATA_SAY_TEAM_FORMAT]), szFormat)
    }
    else
    {
        return 
0
    
}

    return 
1
}

public 
_cm_total_chat_colors(iPluginiParams)
{
    return 
g_iChatColors
}

public 
_cm_total_prefixes(iPluginiParams)
{
    return 
g_iAdminPrefixes
}

public 
_cm_total_say_formats(iPluginiParams)
{
    return 
g_iSayFormats
}

public 
_cm_update_player_data(iPluginiParams)
{
    
UpdateData(get_param(1))

El Abuelo Loco is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-19-2020 , 13:40   Re: ChatMaganer
Reply With Quote #2

Next time please report this in the plugin's thread.
Post your .ini file. This is likely caused due to a user error in the chat format.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 11-19-2020 , 17:12   Re: ChatMaganer
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Next time please report this in the plugin's thread.
Post your .ini file. This is likely caused due to a user error in the chat format.
sorry I didn't know where to post it. as is a Scripting. I thought I was going here.

Here is the ini.

HTML Code:
#==============================================#
# Chat Manager by OciXCrom: Configuration file #
#==============================================#

# Colors: &x01 (DEFAULT), &x03 (TEAM COLOR); &x04 (GREEN); &x05 (WHITE); &x06 (BLUE); &x07 (RED)
# Combining two or more team colors is NOT POSSIBLE in CS 1.6: &x03, &x05, &x06, &x07 - only ONE of these can be used inside a message.

[Main Settings]
# If set to 1, all players will see all chats independent of whether they are dead or alive, excluding the other team's private chat.
# If set to 2, all players will see all chats, including the opposite team's private chat.
ALL_CHAT = 0

# Players with these flags will see all chats at all time, including all team chats.
ADMIN_LISTEN_FLAGS =

# If the message starts with any of these symbols, it will be hidden in chat. Example: @, /, !
BLOCK_FIRST_SYMBOLS = /

# Prefixes for dead and alive players. Yes, you can set a prefix like *ALIVE* too.
DEAD_PREFIX = *Muerto*
ALIVE_PREFIX =

# The standard spectator prefix.
SPEC_PREFIX = *Spectador*

# Team prefixes that are usually shown in the team chat, in brackets.
TEAM_PREFIX_T = TT
TEAM_PREFIX_CT = CT
TEAM_PREFIX_SPEC = Spectador

# Text that will show when the plugin can't detect a player's location when using geoip.
ERROR_TEXT = ?

# Time formatting when $time$ is used. More info here: http://www.cplusplus.com/reference/ctime/strftime/
FORMAT_TIME = %X

# This is the file where chat messages will be logged. If you want to disable logging, leave this setting blank.
CHAT_LOG_FILE = chatmanager.log

# Format to use for the chat logs. Formats are defined in the [Format Definitions] section.
CHAT_LOG_SAY_FORMAT = log_say
CHAT_LOG_TEAM_FORMAT = log_team

# Here you can set a sound that will play when a message is written in chat. If it's blank, no sound will be played.
SAY_SOUND =
SAY_TEAM_SOUND =

# Date format for use with expiration dates where available in sections down below.
# For a list of valid parameters, see: http://www.cplusplus.com/reference/ctime/strftime/
EXPIRATION_DATE_FORMAT = %d.%m.%Y

# What to do when the date for a specific extra has expired?
# 0 = ignore the entire line
# 1 = put a "#" symbol in the beginning of the line
# 2 = remove the entire line from the file
# Note that when the setting is non-zero, the entire file will be rewritten after being read.
EXPIRATION_DATE_BEHAVIOR = 0

[Format Definitions]
# In this section you can define chat formats that you can assign to different users in the [User Formats] section.
# You should create a different format for the say and say_team chat, if you don't wan't them to look the same.
# You can use the following placeholders: $admin_prefix$, $dead_prefix$, $team$, $name$, $custom_name$, $ip$, $steam$, $userid$, $chat_color$, $message$, $time$
# You can also use these, but they need to be enabled in the .sma file first: $health$, $armor$, $frags$, $deaths$, $city$, $country$, $country_code$, $continent$, $continent_code$
# Using OciXCrom's Rank System gives you access to even more placeholders: $rank$, $current_xp$, $next_xp$, $level$, $next_level$, $next_rank$. Only the first one is enabled by default.
# To enable an additional placeholder, simply locate the #define ARG_ line in the beginning of the .sma file and uncomment it (remove //), then recompile the plugin.
# Syntax: format name = format style

format_admin = $dead_prefix$ &x04$admin_prefix$ &x03$custom_name$ &x01: $chat_color$$message$
format_admin_team = $dead_prefix$ ($team$) &x04$admin_prefix$ &x03$custom_name$ &x01: $chat_color$$message$
format_player = $dead_prefix$ &x03$custom_name$ &x01: $chat_color$$message$
format_player_team = $dead_prefix$ ($team$) &x03$custom_name$ &x01: $chat_color$$message$

log_say = [ $ip$ | $steam$ ] $dead_prefix$ $name$: $message$
log_team = [ $ip$ | $steam$ ] ($team$) $dead_prefix$ $name$: $message$

# In the sections down below you can set different prefixes, chat colors and custom names for each player or a group of players.
# You can add an unlimited amount of these extras. Each new extra needs to be added on a new line in the correct section.
# Bear in mind that the extras that are higher in the list have priority over the ones below them.
# This means that if a player for example meets the requirements for 2 or more prefixes, he will receive the one that's first in the list.

# In the syntaxes, you will find a parameter called "type". This parameter can be one of the following: flag, name, ip, steam, anyflag or noprefix.
# If it's set to "flag" (or "flags"), the plugin will check if the player has ALL of the admin flags set in the "info" parameter. You can set multiple flags instead of only one.
# The "name", "ip" and "steam" settings will check if the player's name, IP or SteamID is equal to the one set in the "info" parameter.
# When set to "anyflag", it will check if the player has ANY of the admin flags specified in the "info" parameter.
# Setting it to "noprefix" will check if the player doesn't have a prefix set. The "info" parameter doesn't have a function in this case, so you can leave it blank.

# If you're using OciXCrom's Rank System, you can also use the parameter "level" to check the user's level.

# The "expiration date" parameter is optional, so you can skip it. If set, this will be the date until the extra will be active.
# If the date has passed, the plugin will ignore the entire line. Dates must be written in the same format as set in the DATE_FORMAT setting.
# If the DATE_FORMAT setting is empty or not found in the [Settings] section, the plugin will ignore the expiration date and the extra will be active all the time.

[Admin Prefixes]
# Here you can add custom prefixes to specific players or flags that are shown when using $admin_prefix$.
# Syntax: "type" "info" "prefix" "[expiration date]"

# "name" "OciXCrom" "[Timed Prefix]" "31.12.2030"
# "name" "OciXCrom" "[Scripter]"
# "steam" "STEAM_0:0:50153248" "[CM Creator]"
# "ip" "127.0.0.1" "[BOT]"
"flag" "o" "[Dueño]"
"flag" "n" "[Admin]"
"flag" "t" "[VIP]"
"flag" "mnp" ""
"flag" "" ""

[Chat Colors]
# Here you can add different chat colors to specific players or flags that are shown when using $chat_color$.
# Syntax: "type" "info" "chat color" "[expiration date]"

"flag" "a" "&x04"
"flag" "e" "&x05"
"flag" "" "&x01"

[Name Customization]
# Here you can modify the name shown for certain players when using $custom_name$.
# Syntax: "type" "info" "custom name" "[expiration date]"

"name" "OciXCrom" "&x03Oci&x04XC&x03rom"

[Say/Say_Team Formats]
# Here you can specify the chat style for every user or flag.
# Syntax: "type" "info" "say format" "say_team format" "[expiration date]"

"noprefix" "" "format_player" "format_player_team"
"flag" "" "format_admin" "format_admin_team"
El Abuelo Loco is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-19-2020 , 17:16   Re: ChatMaganer
Reply With Quote #4

Did you modify anything in the .sma file?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 11-19-2020 , 17:24   Re: ChatMaganer
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Did you modify anything in the .sma file?
no, do not modify anything in the sma file.

That is why it seems strange to me that I get that error in the log. because it does not modify anything as well as you uploaded it, compile it and install it.

Last edited by El Abuelo Loco; 11-19-2020 at 17:26.
El Abuelo Loco is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-20-2020 , 07:41   Re: ChatMaganer
Reply With Quote #6

Try updating to the latest version. Yours is over a year old.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



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 13:45.


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