Raised This Month: $30 Target: $400
 7% 

Chat Manager [Admin Prefix & Color Chat]


Post New Thread Reply   
 
Thread Tools Display Modes
Death Stroke
Junior Member
Join Date: Mar 2021
Location: Algeria.
Old 06-25-2022 , 09:15   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #231

Quote:
Originally Posted by OciXCrom View Post
Of course I need to see the plugin first.
Well its level xp system by Perfect Scrash here:-
Attached Files
File Type: sma Get Plugin or Get Source (zpsp_xp_system.sma - 61 views - 44.0 KB)
Death Stroke is offline
sigerman
Senior Member
Join Date: Aug 2013
Location: Argentina, Bs.As.
Old 06-28-2022 , 19:05   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #232

Quote:
Originally Posted by sigerman View Post
Asking for hltv support :O in the demos you can't see the chat
I have a lot of hltv servers recording demos ( extension .dem ). But in neither of them the demos are showing what the players are chatting when I have chat manager plugin activated.

If I deactivate the plugin, then the chats appear again.
sigerman is offline
ALonsoVIP4141
Senior Member
Join Date: May 2021
Location: Philippines
Old 07-14-2022 , 15:01   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #233

i have this problem i need HELP, thnx


Last edited by ALonsoVIP4141; 07-14-2022 at 18:34.
ALonsoVIP4141 is offline
Send a message via ICQ to ALonsoVIP4141 Send a message via AIM to ALonsoVIP4141 Send a message via Yahoo to ALonsoVIP4141 Send a message via Skype™ to ALonsoVIP4141
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 07-15-2022 , 22:52   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #234

Quote:
Originally Posted by ALonsoVIP4141 View Post
i have this problem i need HELP, thnx


have you Enable the Arg of Levels from sma

PHP Code:
//#define ARG_LEVEL             "$level$" 
to
PHP Code:
#define ARG_LEVEL             "$level$" 

do this and recompile the plugin
__________________
SED LYF !!!
SHIELD755 is offline
ALonsoVIP4141
Senior Member
Join Date: May 2021
Location: Philippines
Old 07-16-2022 , 18:34   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #235

Quote:
Originally Posted by SHIELD755 View Post
have you Enable the Arg of Levels from sma

PHP Code:
//#define ARG_LEVEL             "$level$" 
to
PHP Code:
#define ARG_LEVEL             "$level$" 

do this and recompile the plugin
Thanks I didn't think the problem was .sma

Last edited by ALonsoVIP4141; 07-16-2022 at 18:34.
ALonsoVIP4141 is offline
Send a message via ICQ to ALonsoVIP4141 Send a message via AIM to ALonsoVIP4141 Send a message via Yahoo to ALonsoVIP4141 Send a message via Skype™ to ALonsoVIP4141
Nbanow
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 07-24-2022 , 19:07   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #236

Hello! I'm dealing with doubled messages because of my zombie plague XP/LEVEL system (sorry that I'm using different one, it fits well for ZM mod) because the plugin uses custom chat to add a level before the nickname.

SCREENSHOT: https://prnt.sc/wbQdZN4Aw5H7

Could someone help me with the code? Should I change crom's plugin or XP plugin?

XP/LEVELS sma:
PHP Code:
/*

    Copyright(C). 2014. zmd94 ;)
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/
// Uncomment 'IM_USING_ZP50' if your server is running ZP50 and above
//#define IM_USING_ZP50

// if you are using this Custom Level for ZPA, 
// just change line below into #include <zombie_plague_advance> 
#include <zombieplague> 

//Uncomment 'CUSTOM_CHAT' if your want to use custom chat
#define CUSTOM_CHAT

//Uncomment 'DATA_EXPIRED' if your want to enable data expired function
//#define DATA_EXPIRED

//Uncomment 'CHANGE_NAME' if your want to enable player to change their name
//#define CHANGE_NAME

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <nvault_util>
#include <nvault>
#include <engine>
#include <fun>
#if defined IM_USING_ZP50
#include <zp50_core>
#include <zp50_class_zombie>
#endif

new const VERSION[] = "3.2"
new const VAULTNAME[] = "custom_level"
new const RANKS[][]=
{
    
"0"// 0
    
"1"// 1
    
"2"// 2
    
"3"// 3
    
"4"// 4
    
"5"// 5
    
"6"// 6
    
"7"// 7
    
"8"// 8
    
"9"// 9
    
"10"// 10
    
"11"// 11
    
"12"// 12
    
"13"// 13
    
"14"// 14
    
"15"// 15
    
"16"// 16
    
"17"// 17
    
"18" // 18
}

new const 
EXP[] =
{
    
0// 0
    
25// 1
    
85// 2
    
145// 3
    
245// 4
    
417// 5
    
709// 6
    
1206// 7
    
2051// 8
    
3487// 9
    
5929// 10
    
10079// 11
    
17135// 12
    
29131// 13
    
49522// 14
    
84188// 15
    
143121// 16
    
243305// 17
    
413620 // 18
}

#define ADMIN_FLAG    ADMIN_IMMUNITY
#define MAXPLAYERS 32
#define TOPLEVEL 15
#define TASK_INFO 2399

// Bool
new bool:g_bKilledZombie[MAXPLAYERS+1][33]

// String
new g_szMotd[1536]
new 
g_sName[MAXPLAYERS+1][32]

// Variables
new g_iLevel[MAXPLAYERS+1], g_iXP[MAXPLAYERS+1
new 
g_iDamage[MAXPLAYERS+1][33], g_iSprite[MAXPLAYERS+1]
new 
g_iSteamID[MAXPLAYERS+1][32]

new 
g_iZombieScoreg_iHumanScore
new g_iVaultg_msgSayText

new g_iELevelBonusg_iEAPRewardsg_iEHitRecievedg_iEHitDealtg_iEShowScoreg_iEHumanWing_iEHumanWinBonus
g_iEZombieWinBonusg_iEZombieInfectBonusg_iESurvKillBonusg_iENemKillBonusg_iEDamageEXP
g_iEHPBonusg_iEArmorBonus

new g_iSaveTypeg_iConnectMessageg_iELevelIcong_iLevelIconTimeg_iEInformHudg_iHudLocation
g_iHudColorsg_iScoreColorsg_iHumanEXPg_iZombieEXPg_iHeadShotEXPg_iLevelEXPBonusg_iLevelHPBonus
g_iLevelArBonusg_iLevelAPBonusg_iHumanWinEXPg_iZombieWinEXPg_iInfectEXPg_iSurKillEXP
g_iNemKillEXPg_iDamageAmountg_iDamageEXP

#if defined IM_USING_ZP50
new g_iMaxHealth[MAXPLAYERS+1]
new 
g_iEAssistEXPg_iAssistEXPg_iAssistDivide
#endif

#if defined DATA_EXPIRED
new g_iDataExpired
#endif

public plugin_init()
{
    
// Original plugin is by Excalibur007. ;)
    
register_plugin("Custom Level"VERSION"zmd94")
    
    
register_dictionary("custom_level.txt")
    
    
#if defined CUSTOM_CHAT
    
register_clcmd("say""custom_say")
    
register_clcmd("say_team""custom_say_team")
    
#endif
    
    
register_clcmd("say /level""custom_menu")
    
register_clcmd("say_team /level""custom_menu")
    
register_clcmd("say /rank""custom_menu")
    
register_clcmd("say_team /rank""custom_menu")
    
register_clcmd("say /clnext""show_stats")
    
register_clcmd("say_team /lvnext""show_stats")
    
register_clcmd("say /top15""show_global_top")
    
register_clcmd("say_team /top15""show_global_top")
    
register_clcmd("say /ontop""show_online_top")
    
register_clcmd("say_team /ontop""show_online_top")
    
register_clcmd("say /save""save_data")
    
register_clcmd("say_team /save""save_data")
    
    
register_clcmd("free_give","cl_give"ADMIN_FLAG"Enable to give free EXP")

    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
register_event("Damage""event_Damage""be""2!0""3=0""4!0")
    
register_event("DeathMsg""event_DeathMsg""a""1>0")
    
register_event("StatusValue""event_StatusValue""be""1=2""2!0")
    
register_event("TextMsg""event_Restart""a""2&#Game_C""2&#Game_w")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerRespawn"1)
    
    
#if defined CHANGE_NAME
    
register_forwardFM_ClientUserInfoChanged"FwdClientUserInfoChanged" )
    
#endif
    
    
g_iSaveType register_cvar("cl_save_type""2"// 1; Save the EXP via player steamID | 2; Save the EXP via player name 
    #if defined DATA_EXPIRED
    
g_iDataExpired register_cvar("cl_data_expired""5"// This will remove all entries in the vault that are X days old 
    #endif
    
g_iConnectMessage register_cvar("cl_connect_message""1"// Enable connect message
    
g_iHumanEXP register_cvar("cl_human_EXP""1"// Amount of EXP gain from killing a zombie without headshot
    
g_iZombieEXP register_cvar("cl_zombie_EXP""1"// Amount of EXP gain from killing a human
    
g_iHeadShotEXP register_cvar("cl_level_head_EXP""2"//  Amount of EXP gain from killing a zombie with headshot
    
g_iELevelIcon register_cvar("cl_level_icon""1"// Enable level icon
    
g_iLevelIconTime register_cvar("cl_level_icon_time""1.5"// The time for the icon to stay displaying
    
g_iELevelBonus register_cvar("cl_level_bonus""1"// Enable level bonus
    
g_iLevelEXPBonus register_cvar("cl_EXP_bonus""3"// Amount of EXP gain when level up 
    
g_iEHPBonus register_cvar("cl_enable_health_bonus""1"// Enable HP bonus
    
g_iLevelHPBonus register_cvar("cl_health_bonus""25")  // The values of health reward 
    
g_iEArmorBonus register_cvar("cl_enable_armor_bonus""1"// Enable armor bonus
    
g_iLevelArBonus register_cvar("cl_armor_bonus""10"// The values of armor reward 
    
g_iEAPRewards register_cvar("cl_enable_AP_bonus""1"// Enable ammo packs reward when level up
    
g_iLevelAPBonus register_cvar("cl_AP_amount""10"// The values of ammo packs reward 
    
g_iEInformHud register_cvar("cl_level_hud""1"// Enable level hud information
    
g_iHudColors register_cvar("cl_hud_colors""255 0 0")
    
g_iHudLocation register_cvar("cl_hud_position""2"// 1; The position of hud information is in the left | 2; The position of hud information is in the right
    
g_iEDamageEXP register_cvar("cl_level_damage""1"// Enable human to recieve EXP from dealing a damage 
    
g_iDamageAmount register_cvar("cl_damage_amount""950"// Amount of damage need to recieve EXP for human
    
g_iDamageEXP register_cvar("cl_damage_EXP_amount""1"// Amount of EXP gain from dealing a damage
    
g_iEHitRecieved register_cvar("cl_show_hit_recieved""1"// Enable showing recieved damage 
    
g_iEHitDealt register_cvar("cl_show_hit_dealt""1"// Enable showing dealt damage
    
g_iEShowScore register_cvar("cl_show_score""1"// Enable showing score for zombie and human
    
g_iScoreColors register_cvar("cl_score_colors""0 255 0")
    
g_iEHumanWin register_cvar("cl_human_win""1"// Enable human to be a winner if nobody win
    
g_iEHumanWinBonus register_cvar("cl_human_win_bonus""1"// Enable win bonus for human
    
g_iHumanWinEXP register_cvar("cl_human_win_amount""1"// EXP given to human for winning
    
g_iEZombieWinBonus register_cvar("cl_zombie_win_bonus""1"// Enable win bonus for zombie
    
g_iZombieWinEXP register_cvar("cl_zombie_win_amount""1"// EXP given to zombie for winning
    
g_iEZombieInfectBonus register_cvar("cl_zombie_infect_bonus""1"// Enable EXP bonus for zombie when infecting human
    
g_iInfectEXP register_cvar("cl_zombie_infect_amount""1"// EXP given to zombie for infecting human
    
g_iESurvKillBonus register_cvar("cl_survivor_kill_bonus""1"// Enable kill bonus when killing survivor
    
g_iSurKillEXP register_cvar("cl_survivor_bonus_amount""1"// Then amount of EXP bonus by killing survivor
    
g_iENemKillBonus register_cvar("cl_nemesis_kill_bonus""1"// Enable kill bonus when killing nemesis
    
g_iNemKillEXP register_cvar("cl_nemesis_bonus_amount""1"// Then amount of EXP bonus by killing nemesis
    #if defined IM_USING_ZP50
    
g_iEAssistEXP register_cvar("cl_enable_assist""1"// Enable EXP given for assisting players
    
g_iAssistEXP register_cvar("cl_level_assist_EXP""1"// Amount of EXP gain from assisting a non-zombie killer.
    
g_iAssistDivide register_cvar("cl_level_assist_divide""5"// Amount of damage [Zombie Max health / CVAR] needed to get an assist
    #endif
    
    
g_msgSayText get_user_msgid("SayText")
    
    
#if defined CUSTOM_CHAT
    
register_message(g_msgSayText"message_SayText")
    
#endif
    
    // Score Inform. ;)
    
if(get_pcvar_num(g_iEShowScore))
    {
        
set_task(1.0"ShowScore"0__"b")
    }
}

public 
plugin_precache()
{
    if(
get_pcvar_num(g_iELevelIcon))
    {
        new 
szFile[35]
        for(new 
0sizeof(RANKS); i++)
        {
            
formatex(szFilecharsmax(szFile), "sprites/zombie_plague/level/%i.spr"i)
            
g_iSprite[i] = precache_model(szFile)
        }
    }
}

public 
plugin_cfg()
{
    new 
sCFGdir[32]
    
get_configsdir(sCFGdircharsmax(sCFGdir))
    
server_cmd("exec %s/cl_system.cfg"sCFGdir)
    
    
g_iVault nvault_open(VAULTNAME)
    if(
g_iVault == INVALID_HANDLE)
    {
        new 
szText[128]; formatex(szText127"Error opening CLeS database [%s]"VAULTNAME);
        
set_fail_state(szText)
    }
    
    
server_print("CLeS database [%s] successfully loaded!"VAULTNAME)
    
    
#if defined DATA_EXPIRED
    
nvault_prune(g_iVault0get_systime() - (86400 get_pcvar_num(g_iDataExpired)))
    
#endif
    
    
FormatTop(TOPLEVEL)
}

public 
plugin_end()
{
    
nvault_close(g_iVault)
}

public 
zp_round_ended(iTeam)
{
    new 
iPlayers[MAXPLAYERS], iPlayerCountiplayer
    
    
switch(iTeam)
    {
        case 
WIN_ZOMBIES
        {
            if(
get_pcvar_num(g_iEShowScore))
            {
                
g_iZombieScore ++ 
            }
            
            if(
get_pcvar_num(g_iEZombieWinBonus))
            {
                
get_players(iPlayersiPlayerCount"ac"
                for(
0iPlayerCounti++)
                {
                    
player iPlayers[i]
                    if(
zp_get_user_zombie(player))
                    {
                        
g_iXP[player] += get_pcvar_num(g_iZombieWinEXP)
                        
sChatColor(player"^x04[XP]^x03 %L"LANG_PLAYER"CL_ZOMBIE_WIN"get_pcvar_num(g_iZombieWinEXP))
                        
                        
ReviewLevel(player)
                    }
                }
            }
        }
        case 
WIN_HUMANS
        {
            if(
get_pcvar_num(g_iEShowScore))
            {
                
g_iHumanScore ++ 
            }
            
            if(
get_pcvar_num(g_iEHumanWinBonus))
            {
                
get_players(iPlayersiPlayerCount"ac"
                for(
0iPlayerCounti++)
                {    
                    
player iPlayers[i]
                    if(!
zp_get_user_zombie(player))
                    {
                        
g_iXP[player] += get_pcvar_num(g_iHumanWinEXP)
                        
sChatColor(player"^x04[XP]^x03 %L"LANG_PLAYER"CL_HUMAN_WIN"get_pcvar_num(g_iHumanWinEXP))
                        
                        
ReviewLevel(player)
                    }
                }
            }
        }
        case 
WIN_NO_ONE
        {
            if(
get_pcvar_num(g_iEHumanWin))
            {
                
g_iHumanScore ++
                
                if(
get_pcvar_num(g_iEHumanWinBonus))
                {
                    
get_players(iPlayersiPlayerCount"ac"
                    for(
0iPlayerCounti++)
                    {
                        
player iPlayers[i]
                        if(!
zp_get_user_zombie(player))
                        {
                            
g_iXP[player] += get_pcvar_num(g_iHumanWinEXP)
                            
sChatColor(player"^x04[XP]^x03 %L"LANG_PLAYER"CL_HUMAN_SURVIVE"get_pcvar_num(g_iHumanWinEXP))
                            
                            
ReviewLevel(player)
                        }
                    }
                }
            }
        }
    }
}

public 
client_authorized(id)
{
    switch(
get_pcvar_num(g_iSaveType))
    {
        case 
1:
        {
            
get_user_authid(idg_iSteamID[id], charsmax(g_iSteamID))
        }
        case 
2:
        {
            
get_user_name(idg_sName[id], charsmax(g_sName))
        }
    }
}

public 
client_putinserver(id)
{
    if(
is_user_connected(id))
    {
        
LoadData(id)
        
        if(
get_pcvar_num(g_iConnectMessage))
        {
            new 
szName[32]
            
get_user_name(idszNamecharsmax(szName))
            
sChatColor(0"^x04[XP]^x01 %L"LANG_PLAYER"CL_CONNECT_MESSAGE"szNameRANKS[g_iLevel[id]], g_iXP[id])
        }
        
        if(
get_pcvar_num(g_iEInformHud))
        {
            
set_task(1.0"InfoHud"id+TASK_INFO__"b")
        }
    }
}

public 
client_disconnect(id)
{
    
SaveData(id)
    
    
remove_task(id+TASK_INFO)
    
    
g_iLevel[id] = 0
    g_iXP
[id] = 0
}

public 
InfoHud(id)
{
    
id -= TASK_INFO
    
    
new PlayerInfoHud CreateHudSyncObj()
    new 
iHudLocation get_pcvar_num(g_iHudLocation)
    
    new 
szColors[16]
    new 
szRed[4], szGreen[4], szBlue[4]
    new 
iRediGreeniBlue
    
    get_pcvar_string
(g_iHudColorsszColorscharsmax(szColors))
    
parse(szColorsszRedcharsmax(szRed), szGreencharsmax(szGreen), szBluecharsmax(szBlue))
    
iRed str_to_num(szRed); iGreen str_to_num(szGreen); iBlue str_to_num(szBlue); 
    
    if(!
is_user_alive(id))
    {
        static 
iSpeciSpec entity_get_int(idEV_INT_iuser2)
        
        if(!
is_user_alive(iSpec)) 
            return
        
        new 
iSpecName[32]
        
get_user_name(iSpeciSpecNamecharsmax(iSpecName))
        
        switch(
iHudLocation)
        {
            case 
1:
            {
                if(
g_iLevel[iSpec] == 18)
                {
                    
set_hudmessage(iRediGreeniBlue0.010.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[•Spectating: %s] ^n[•Level: Complete] ^n[•EXP: Complete]"iSpecName
                }
                else
                {
                    
set_hudmessage(iRediGreeniBlue0.010.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[•Spectating: %s] ^n[•Level: %s] ^n[•EXP: %d/ %d]"iSpecNameRANKS[g_iLevel[iSpec]], g_iXP[iSpec], EXP[g_iLevel[iSpec] + 1]) 
                }
            }
            case 
2:
            {
                if(
g_iLevel[iSpec] == 18)
                {
                    
set_hudmessage(iRediGreeniBlue0.750.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[•Spectating: %s] ^n[•Level: Complete] ^n[•EXP: Complete]"iSpecName
                }
                else
                {
                    
set_hudmessage(iRediGreeniBlue0.750.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[•Spectating: %s] ^n[•Level: %s] ^n[•EXP: %d/ %d]"iSpecNameRANKS[g_iLevel[iSpec]], g_iXP[iSpec], EXP[g_iLevel[iSpec] + 1]) 
                }
            }
        }
    }
    else
    {
        switch(
iHudLocation)
        {
            case 
1:
            {
                if(
g_iLevel[id] == 18)
                {
                    
set_hudmessage(iRediGreeniBlue0.010.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[• Level: Complete] ^n[• Experience: Complete]"
                }
                else
                {
                    
set_hudmessage(iRediGreeniBlue0.010.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[• Level: %s] ^n[• Experience: %d/ %d]",RANKS[g_iLevel[id]], g_iXP[id], EXP[g_iLevel[id] + 1]) 
                }
            }
            case 
2:
            {
                if(
g_iLevel[id] == 18)
                {
                    
set_hudmessage(iRediGreeniBlue0.750.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[• Level: Complete] ^n[• Experience: Complete]"
                }
                else
                {
                    
set_hudmessage(iRediGreeniBlue0.750.2806.012.00.00.0, -1
                    
ShowSyncHudMsg(idPlayerInfoHud,"[• Level: %s] ^n[• Experience: %d/ %d]",RANKS[g_iLevel[id]], g_iXP[id], EXP[g_iLevel[id] + 1]) 
                }
            }
        }
    }


public 
ShowScore()
{
    new 
ScoreHud CreateHudSyncObj()
    
    new 
szColors[16]
    new 
szRed[4], szGreen[4], szBlue[4]
    new 
iRediGreeniBlue
    
    get_pcvar_string
(g_iScoreColorsszColorscharsmax(szColors))
    
parse(szColorsszRedcharsmax(szRed), szGreencharsmax(szGreen), szBluecharsmax(szBlue))
    
iRed str_to_num(szRed); iGreen str_to_num(szGreen); iBlue str_to_num(szBlue);  
    
    
set_hudmessage(iRediGreeniBlue, -1.00.02012.012.00.00.0, -1)
    
ShowSyncHudMsg(0ScoreHud"[Zombie] • [Human]^n[%s%d] ••• [%s%d]",g_iZombieScore >= 10 "" "0"g_iZombieScoreg_iHumanScore >= 10 "" "0"g_iHumanScore)
}

public 
custom_menu(id)
{
    new 
sMenu menu_create("\yLevel Menu \r3.1""custom_handler")
    
    
menu_additem(sMenu"\wCurrent TOP players.""1"0)
    
menu_additem(sMenu"\wCurrent ONLINE TOP players.""2"0)
    
menu_additem(sMenu"\wEXP to the next level.""3"0)
    
menu_additem(sMenu"\wSave your EXP!""4"0)
    
    
menu_display(idsMenu0)
}

public 
custom_handler(idmenuitem)
{
    if(
item == MENU_EXIT
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    switch(
item)
    {
        case 
0show_global_top(id)
        case 
1show_online_top(id)
        case 
2show_stats(id)
        case 
3save_data(id)
    }
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

#if defined CUSTOM_CHAT
public custom_say(id)
{
    new 
szMessage[192], szName[32]
    
    
read_args(szMessagecharsmax(szMessage))
    
remove_quotes(szMessage)
    
get_user_name(idszNamecharsmax(szName))
    
    if(
equali(szMessage[0], " ") || equali(szMessage[0], "") || !is_valid_msg(szMessage))
        return 
PLUGIN_HANDLED_MAIN
    
    
if(is_user_alive(id))
    {
        
format(szMessagecharsmax(szMessage), "^4[%s] ^3%s : ^1%s"RANKS[g_iLevel[id]], szNameszMessage)
    }
    else
    {
        
format(szMessagecharsmax(szMessage), "^1*DEAD* ^4[%s] ^3%s : ^1%s"RANKS[g_iLevel[id]], szNameszMessage)
    }
    
    new 
iPlayers[MAXPLAYERS], iPlayerCountiplayer
    get_players
(iPlayersiPlayerCount"ch"
    for(
0iPlayerCounti++)
    {
        
player iPlayers[i]
        if(
is_user_alive(id) && is_user_alive(player) || !is_user_alive(id) && !is_user_alive(player))
        {
            
message_begin(MSG_ONEg_msgSayText, {000}, player)
            
write_byte(id)
            
write_string(szMessage)
            
message_end()
        }
    }
    
    return 
PLUGIN_CONTINUE
}

public 
custom_say_team(id)
{
    new 
szMessage[192], szName[32]
    
    
read_args(szMessagecharsmax(szMessage))
    
remove_quotes(szMessage)
    
get_user_name(idszNamecharsmax(szName))
    
    if(
equali(szMessage[0], " ") || equali(szMessage[0], "") || !is_valid_msg(szMessage))
        return 
PLUGIN_HANDLED_MAIN
    
    
if(is_user_alive(id))
    {
        
format(szMessagecharsmax(szMessage), "^4[%s] ^3%s : ^1%s"RANKS[g_iLevel[id]], szNameszMessage)
    }
    else
    {
        
format(szMessagecharsmax(szMessage), "^1*DEAD* ^4[%s] ^3%s : ^1%s"RANKS[g_iLevel[id]], szNameszMessage)
    }
    
    new 
iPlayers[MAXPLAYERS], iPlayerCountiplayer
    get_players
(iPlayersiPlayerCount"ch"
    for(
0iPlayerCounti++)
    {
        
player iPlayers[i]
        if(
is_user_alive(id) && is_user_alive(player) && get_user_team(id) == get_user_team(player) || !is_user_alive(id) && !is_user_alive(player) && get_user_team(id) == get_user_team(player))
        {
            
message_begin(MSG_ONEg_msgSayText, {000}, player)
            
write_byte(id)
            
write_string(szMessage)
            
message_end()
        }
    }
    
    return 
PLUGIN_CONTINUE
}
#endif

public cl_give(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
    {                
        return 
PLUGIN_HANDLED
    
}
    
    new 
iTarget[32], iCount[32]    
    
read_argv(1iTargetcharsmax(iTarget))
    
read_argv(2iCountcharsmax(iCount))
    
    new 
target_idiName[32], iNameID[32]
    
target_id find_player("bl"iTarget)
    
    
get_user_name(target_idiNamecharsmax(iName)) 
    
get_user_name(idiNameIDcharsmax(iNameID))
    
    if(!
target_id
    {
        
console_print(id"Can't find that player")
        return 
PLUGIN_HANDLED
    
}
    
    if(
read_argc() != 3)
    {
        return 
PLUGIN_HANDLED    
    
}
    
    if(
str_to_num(iCount) < (EXP[g_iLevel[target_id] + 1] - g_iXP[target_id]))
    {
        if(
str_to_num(iCount) == 0)
        {
            
console_print(id"EXP for %s is %i / %i"iNameg_iXP[target_id], EXP[g_iLevel[target_id] + 1])
        }
        else
        {
            
console_print(id"%s has been given %i EXP"iNamestr_to_num(iCount))
            
g_iXP[target_id] += str_to_num(iCount)
        }
    }
    else
    {
        
console_print(id"Maximum EXP allowed for %s: %i"iName, (EXP[g_iLevel[target_id] + 1] - g_iXP[target_id]))
    }
    
    return 
PLUGIN_HANDLED;
}

public 
show_stats(id)
{
    if(
is_user_connected(id))
    {
        
sChatColor(id"^x04[XP]^x03 %L"id"CL_SHOW_STAT"RANKS[g_iLevel[id]], (EXP[g_iLevel[id] + 1] - g_iXP[id]))
    }
}

public 
show_online_top(id)
{
    static 
Sort[33][2]
    new 
szName[MAXPLAYERS+1][32]
    new 
players[32], numcountindex
    
    get_players
(playersnum)
    for(new 
0numi++)
    {
        
index players[i]
        
get_user_name(indexszName[index], charsmax(szName))
        
        
Sort[count][0] = index
        Sort
[count][1] = g_iXP[index]
        
count++
    }
    
    
SortCustom2D(Sortcount"CompareEXP")
    
    new 
clamp(count010)
    new 
kindexszMotd2[1536], len
    szMotd2
[0] = 0
    
    add
(szMotd2charsmax(szMotd2),
    
"<html><style>\
    body{background:#040404;font-family:Verdana, Arial, Sans-Serif;font-size:19pt;}\
    .t{color:#808080;text-align:left; }\
    #h{background: #0066CC url('http://onlyarg.com/foro/images/Amiral/thead.png') repeat-x;color:#E0E0E0;font-weight:bold;}\
    #p{color:#D41313;}\
    #n{color:#fff;}\
    </style><body>\
    <table cellspacing=0 width=100% class=t>"
)
    
    
add(szMotd2charsmax(szMotd2),
    
"<tr><td id=h width=7%>#</td>\
    <td id=h>NAME</td>\
    <td id=h>LEVEL</td>\
    <td id=h>EXP</td></tr>"
)
    
    
len strlen(szMotd2)
    for(new 
0yx++)
    {
        
kindex Sort[x][0]
        
        
replace_all(szName[kindex], charsmax(szName), "<""&lt")
        
replace_all(szName[kindex], charsmax(szName), ">""&gt")
        
        
len += formatex(szMotd2[len], charsmax(szMotd2)-len,
        
"<tr><td id=p>%d</td>\
        <td id=n>%s</td>\
        <td>%d</td>\
        <td>%d</td>"
, (x+1), szName[kindex], g_iLevel[kindex], g_iXP[kindex])
    }
    
    
add(szMotd2charsmax(szMotd2), "</table></body></html>")
    
show_motd(idszMotd2"ONLINE PLAYERS")
}

public 
CompareEXP(elem1[], elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
    
    return 
0;
}

public 
show_global_top(id)
{
    
show_motd(idg_szMotd"GLOBAL PLAYERS")
}

FormatTop(iNum)
{
    
enum _:sVaultData
    
{
        
VD_Key[64],
        
VD_Value
    
}
    
    new 
sVault nvault_util_open(VAULTNAME)
    new Array:
entries ArrayCreate(sVaultData)
    
    new 
sizeEntries;
    new 
numEntries nvault_util_count(sVault)
    new 
data[sVaultData], value[128], data2[sVaultData]
    
    for(new 
0postimestampnumEntriesi++) 
    {
        
pos nvault_util_read(sVaultposdata[VD_Key], charsmax(data[VD_Key]), valuecharsmax(value), timestamp);
        
data[VD_Value] = str_to_num(value)
        
        if(
sizeEntries == 0
        {
            
ArrayPushArray(entriesdata)
            
sizeEntries++
        } 
        else 
        {
            for(
timestamp 0timestamp <= sizeEntriestimestamp++) 
            {
                if(
timestamp == sizeEntries
                {
                    if(
sizeEntries iNum
                    {
                        
ArrayPushArray(entriesdata)
                        
sizeEntries++
                    }
                    
                    break
                }
                
                
ArrayGetArray(entriestimestampdata2)
                if(
data[VD_Value] >= data2[VD_Value]) 
                {
                    
ArrayInsertArrayBefore(entriestimestampdata)
                    if(
sizeEntries iNum
                    {
                        
sizeEntries++
                    } 
                    else 
                    {
                        
ArrayDeleteItem(entriessizeEntries);
                    }
                    
                    break
                }
            }
        }
    }
    
    
nvault_util_close(sVault)
    
    new 
iLen
    
new len charsmax(g_szMotd)
    
    
iLen formatex(g_szMotdlen"<STYLE>body{background:#212121;color:#d1d1d1;font-family:Arial}table{width:100%%;font-size:19px}</STYLE><table cellpadding=1 cellspacing=1 border=0>")
    
iLen += formatex(g_szMotd[iLen], len iLen"<tr bgcolor=#333333><th width=1%%><align=left font color=white> %s <th width=5%%> %-22.22s <th width=5%%> %s""#""NAME""LEVEL")

    new 
i
    
for(0sizeEntriesi++)
    {
        
ArrayGetArray(entriesidata); 
        
data[VD_Key][20] = 0;
        
        
replace_all(data[VD_Key], charsmax(data[VD_Key]), "<""&lt;")
        
replace_all(data[VD_Key], charsmax(data[VD_Key]), ">""&gt;")
        
        
iLen += formatex(g_szMotd[iLen], len iLen"<tr align=left%s><td align=left><font color=white> %d. <td> %-22.22s <td> %d"" bgcolor=#2b5b95",(i+1), data[VD_Key], data[VD_Value])
    }
    
    
ArrayDestroy(entries);
    
iLen += formatex(g_szMotd[iLen], len iLen"</table></body>")
}

public 
save_data(id)
{
    if(
is_user_alive(id))
    {
        
SaveData(id)
        
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_SAVE")
    }
}

public 
event_new_round()
{
    new 
iPlayers[MAXPLAYERS], iPlayerCountiplayer
    get_players
(iPlayersiPlayerCount"a"
    for(
0iPlayerCounti++)
    {
        
player iPlayers[i]
        
g_iDamage[player][player] = 0
    
}
}

public 
event_Restart()
{
    if(
get_pcvar_num(g_iEShowScore))
    {
        
g_iZombieScore 0
        g_iHumanScore 
0
    
}
}

public 
event_Damage(iVictim)
{
    static 
iAttackeriAttacker get_user_attacker(iVictim)
    static 
iHitiHit read_data(2)
    
    new 
AttackerHud CreateHudSyncObj()
    new 
VictimHud CreateHudSyncObj()
    
    if(
iAttacker == iVictim || !is_user_alive(iAttacker) || !is_user_alive(iVictim))
        return
        
    if(
get_pcvar_num(g_iEHitRecieved))
    {
        
set_hudmessage(255000.450.5020.14.00.10.1, -1)
        
ShowSyncHudMsg(iVictimVictimHud"%i^n"iHit)    
    }
    
    if(
get_pcvar_num(g_iEHitDealt))
    {
        
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
        
ShowSyncHudMsg(iAttackerAttackerHud"%i^n"iHit)
    }
    
    
Show_spectate(iVictimiAttackeriHit)
    
    if(
zp_get_user_zombie(iVictim) && !zp_get_user_survivor(iAttacker))
    {
        
g_iDamage[iAttacker][iVictim] += read_data(2)
        if (
get_pcvar_num(g_iEDamageEXP))
        {
            if(
g_iDamage[iAttacker][iVictim] >= get_pcvar_num(g_iDamageAmount))
            {    
                
g_iXP[iAttacker] += get_pcvar_num(g_iDamageEXP)
                
                
sChatColor(iAttacker"^x04[XP]^x01 %L"LANG_PLAYER"CL_DEALT_DAMAGE"get_pcvar_num(g_iDamageEXP), get_pcvar_num(g_iDamageAmount))
                
g_iDamage[iAttacker][iVictim] = 0
                
                ReviewLevel
(iAttacker)
            }
        }
    }
}

public 
Show_spectate(iVictimiAttackeriHit)
{
    new 
AttackerSpecHud CreateHudSyncObj()
    new 
VictimSpecHud CreateHudSyncObj()
    
    new 
Players[MAXPLAYERS], iPlayerCountiid
    get_players
(PlayersiPlayerCount"bc"
    for (
0iPlayerCounti++) 
    {
        
id Players[i]
        if (
id != iVictim && entity_get_int(idEV_INT_iuser2) == iVictim)
        {
            
set_hudmessage(255000.450.5020.14.00.10.1, -1)
            
ShowSyncHudMsg(idVictimSpecHud"%i^n"iHit)
        }
        
        if (
id != iAttacker && entity_get_int(idEV_INT_iuser2) == iAttacker)
        {
            
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
            
ShowSyncHudMsg(idAttackerSpecHud"%i^n"iHit)            
        }
    }
}

public 
event_DeathMsg()
{
    new 
iKilleriKiller read_data(1)
    new 
iVictimiVictim read_data(2)
    new 
iIsHeadshotiIsHeadshot read_data(3)
    
    if(
iVictim == iKiller || !is_user_alive(iKiller))
        return
    
    if(!
zp_get_user_zombie(iKiller) || zp_get_user_survivor(iKiller))
    {
        if(
zp_get_user_nemesis(iVictim))
        {
            if (
get_pcvar_num(g_iESurvKillBonus))
            {
                
g_iXP[iKiller] += get_pcvar_num(g_iNemKillEXP)
                
sChatColor(iKiller"^x04[XP]^x03 %L"LANG_PLAYER"CL_KILL_NEMESIS"get_pcvar_num(g_iNemKillEXP))
                
                
ReviewLevel(iKiller)
            }
        }
        else
        {
            if(
iIsHeadshot)
            {
                
g_bKilledZombie[iKiller][iVictim] = true
                
                g_iXP
[iKiller] += get_pcvar_num(g_iHeadShotEXP)
                
sChatColor(iKiller"^x04[XP]^x03 %L"LANG_PLAYER"CL_HEADSHOT_KILL"get_pcvar_num(g_iHeadShotEXP))
            }
            else
            {
                
g_bKilledZombie[iKiller][iVictim] = true
                
                g_iXP
[iKiller] += get_pcvar_num(g_iHumanEXP)
                
sChatColor(iKiller"^x04[XP]^x03 %L"LANG_PLAYER"CL_KILL"get_pcvar_num(g_iHumanEXP))
            }
            
            
ReviewLevel(iKiller)
            
            
#if defined IM_USING_ZP50
            
if(get_pcvar_num(g_iEAssistEXP))
            {
                new 
iPlayers[MAXPLAYERS], iPlayerCountiid
                get_players
(iPlayersiPlayerCount"ah"
                for(
0iPlayerCounti++)
                {
                    
id iPlayers[i]
                    
                    if(
g_iDamage[id][iVictim] >= g_iMaxHealth[iVictim]/ get_pcvar_num(g_iAssistDivide))
                    {    
                        if(!
g_bKilledZombie[id][iVictim] && !zp_core_is_zombie(id))
                        {
                            
g_iXP[id] += get_pcvar_num(g_iAssistEXP)
                            
                            new 
szName[32]
                            
get_user_name(iKillerszNamecharsmax(szName))
                            
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_ASSIST"get_pcvar_num(g_iAssistEXP), RANKS[g_iLevel[iKiller]], szName)
                            
                            
ReviewLevel(id)
                            
                            
g_iDamage[id][iVictim] = 0
                        
}
                        else
                        {
                            
g_bKilledZombie[id][iVictim] = false
                        
}
                    }
                }
            }
            
#endif
        
}
    }
    else if(
zp_get_user_zombie(iKiller) || zp_get_user_nemesis(iKiller))
    {
        if(
zp_get_user_survivor(iVictim))
        {
            if(
get_pcvar_num(g_iENemKillBonus))
            {
                
g_iXP[iKiller] += get_pcvar_num(g_iSurKillEXP)
                
sChatColor(iKiller"^x04[XP]^x03 %L"LANG_PLAYER"CL_KILL_SURVIVOR"get_pcvar_num(g_iSurKillEXP))
                
                
ReviewLevel(iKiller)
            }
        }
        else
        {
            
g_iXP[iKiller] += get_pcvar_num(g_iZombieEXP)
            
sChatColor(iKiller"^x04[XP]^x03 %L"LANG_PLAYER"CL_KILL_HUMAN"get_pcvar_num(g_iZombieEXP))
            
            
ReviewLevel(iKiller)
        }
    }
}

public 
ReviewLevel(id)
{
    while((
g_iLevel[id] < 18 && g_iXP[id] >= EXP[g_iLevel[id] + 1]))
    {
        
g_iLevel[id] += 1
        sChatColor
(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_LEVEL_UP"RANKS[g_iLevel[id]])
        
        if(
get_pcvar_num(g_iELevelBonus))
        {
            
g_iXP[id] += get_pcvar_num(g_iLevelEXPBonus)
            
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_BONUS_EXP"get_pcvar_num(g_iLevelEXPBonus))
        
            
iBonus(id)
        }
        
        if(
get_pcvar_num(g_iEAPRewards))
        {
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + get_pcvar_num(g_iLevelAPBonus))
            
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_BONUS_AP"get_pcvar_num(g_iLevelAPBonus))
        }
    }
}

public 
event_StatusValue(id)
{
    if(!
get_pcvar_num(g_iELevelIcon))
        return
    
    new 
pid read_data(2)
    new 
pidlevel g_iLevel[pid]
    
    if(!
pev_valid(pid) || !is_user_alive(pid) || zp_get_user_zombie(pid))
        return
    
    new 
flTime floatround(get_pcvar_float(g_iLevelIconTime) * 10)
    if (
flTime 0)
    {
        
Create_TE_PLAYERATTACHMENT(idpid55g_iSprite[pidlevel], flTime)
    }
}

public 
fw_PlayerRespawn(id)
{
    if(
is_user_alive(id))
    {
        if(
get_pcvar_num(g_iELevelBonus))
        {
            
set_task(5.0"iBonus"id)
        }
        
        
set_task(50.0"iInform"id)
        
set_task(120.0"iSave"id)
    }
}

public 
iBonus(id)
{
    if(
is_user_alive(id) && !zp_get_user_zombie(id))
    {
        new 
iHealth g_iLevel[id]* get_pcvar_num(g_iLevelHPBonus)
        new 
iArmor g_iLevel[id]* get_pcvar_num(g_iLevelArBonus)
        
        if(
get_pcvar_num(g_iEHPBonus))
        {
            
set_user_health(idget_user_health(id) + iHealth)
        }
        
        if(
get_pcvar_num(g_iEArmorBonus))
        {
            
set_user_armor(idget_user_armor(id) + iArmor)
        }
        
        if(
get_pcvar_num(g_iEHPBonus) && get_pcvar_num(g_iEArmorBonus))
        {
            
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_INFORM"RANKS[g_iLevel[id]], iHealthiArmor)
        }
    }
}

public 
iInform(id)
{
    if(
is_user_alive(id))
    {
        
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_INFORM_2")
    }
}

public 
iSave(id)
{
    if(
is_user_alive(id))
    {
        
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_INFORM_3")
    }
}

#if defined CUSTOM_CHAT
public message_SayText(id)
{
    return 
PLUGIN_HANDLED
}
#endif

#if defined IM_USING_ZP50
public zp_fw_core_infect_post(idattacker)
{
    if(
zp_class_zombie_get_current(id) == ZP_INVALID_ZOMBIE_CLASS)
        return;
    
    
g_iMaxHealth[id] = zp_class_zombie_get_max_health(idzp_class_zombie_get_current(id))
    
    if(
get_pcvar_num(g_iEZombieInfectBonus))
    {
        if (
is_user_alive(attacker) && attacker != id)
        {
            
g_iXP[attacker] += get_pcvar_num(g_iInfectEXP)
            
sChatColor(attacker"^x04[XP]^x03 %L"LANG_PLAYER"CL_INFECT"get_pcvar_num(g_iInfectEXP))
            
            
ReviewLevel(id)
        }
    }
}
#else
public zp_user_infected_post(idinfector)
{
    if(
get_pcvar_num(g_iEZombieInfectBonus))
    {
        if(
is_user_alive(infector) && infector != id)
        {
            
g_iXP[infector] += get_pcvar_num(g_iInfectEXP)
            
sChatColor(infector"^x04[XP]^x03 %L"LANG_PLAYER"CL_INFECT"get_pcvar_num(g_iInfectEXP))
            
            
ReviewLevel(id)
        }
    }
}
#endif

#if defined CHANGE_NAME
public FwdClientUserInfoChangedidszBuffer )
{
    if ( !
is_user_connectedid ) )
        return 
FMRES_IGNORED;
        
    static 
szNewName[32];
 
    
engfuncEngFunc_InfoKeyValueszBuffer"name"szNewNamecharsmax(szNewName));
    
    if(
equal(szNewNameg_sName[id]))
        return 
FMRES_IGNORED;
    
    
SaveData(id)
    
    
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_CHANGE_NAME2"g_sName[id], szNewName)
    
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_CHANGE_NAME3"szNewName)
    
    
copy(g_sName[id], charsmax(g_sName[]), szNewName)
    
LoadData(id)
    
    
sChatColor(id"^x04[XP]^x03 %L"LANG_PLAYER"CL_CHANGE_NAME4")
    
    return 
FMRES_IGNORED;

#endif

SaveData(id)
{
    new 
szData[32], szKey[40]
    switch(
get_pcvar_num(g_iSaveType))
    {
        case 
1:
        {
            
formatex(szKeycharsmax(szKey), "%s"g_iSteamID[id])
        }
        case 
2:
        {
            
formatex(szKeycharsmax(szKey), "%s"g_sName[id])
        }
    }
    
    
formatex(szDatacharsmax(szData), "%d %d"g_iLevel[id], g_iXP[id])
    
nvault_set(g_iVaultszKeyszData)
}

LoadData(id)
{
    new 
szData[32], szKey[40]
    switch(
get_pcvar_num(g_iSaveType))
    {
        case 
1:
        {
            
formatex(szKeycharsmax(szKey), "%s" g_iSteamID[id])
        }
        case 
2:
        {
            
formatex(szKeycharsmax(szKey), "%s"g_sName[id])
        }
    }
    
    if(
nvault_get(g_iVaultszKeyszDatacharsmax(szData)))
    {
        new 
iSpacePos contain(szData" ")
        if(
iSpacePos > -1)
        {
            new 
szLevel[8], szXP[32]
            
            
parse(szDataszLevelcharsmax(szLevel), szXPcharsmax(szXP))
            
            
g_iLevel[id] = str_to_num(szLevel)
            
g_iXP[id] = str_to_num(szXP)
        }
    }
}

#if defined CUSTOM_CHAT
bool:is_valid_msg(const szMessage[])
{
    if(
szMessage[0] == '@' || szMessage[0] == '/' || szMessage[0] == '!' || !strlen(szMessage))
        return 
false
        
    
return true
}
#endif

stock Create_TE_PLAYERATTACHMENT(identityvOffsetiSpritelife)
{
    
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_id)
    
write_byte(TE_PLAYERATTACHMENT)
    
write_byte(entity)
    
write_coord(vOffset)
    
write_short(iSprite)
    
write_short(life)
    
message_end()
}

stock sChatColor(const id, const input[], any:...)
{
    new 
count 1players[32], iplayer
    
static msg[191]

    if(
numargs() == 2)
        
copy(msg190input)
    else
        
vformat(msg190input3)

    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!t""^3")
    
    if(
id) {
        if(!
is_user_connected(id)) return
        
players[0] = id
    
}
    else 
get_players(playerscount"ch")

    for(
0counti++)
    {
        
player players[i]
        
        
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
        
write_byte(player)
        
write_string(msg)
        
message_end()
    }

Nbanow is offline
per4shK
Junior Member
Join Date: Jan 2022
Location: Georgia
Old 08-13-2022 , 13:16   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #237

Recently, I re-uploaded the Georgian translation which was also made by me for your plugin called "OciXCrom's Rank System". I have decided to also make a translation for this plugin of yours.
Code:
[ge] -- per4shK
CM_MENU_TITLE = \y[\rChat Manager\y] \wMotamshis Parametrebi
CM_MENU_PREFIX = Prefiqsi
CM_MENU_CHAT_COLOR = Chatis Feri
CM_MENU_CUSTOM_NAME = Specialuri Saxeli
CM_MENU_ENABLED = \y[CHARTULIA]
CM_MENU_DISABLED = \r[GATISHULIA]
per4shK is offline
Mergim
New Member
Join Date: Sep 2020
Old 08-20-2022 , 20:06   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #238

How to make this format.

Admin can see dead chat of both teams, but can't see their team chat no matter alive or dead.

Only Admin can see all chat, not a player but without team chat, never team chat.
Mergim is offline
Mergim
New Member
Join Date: Sep 2020
Old 08-22-2022 , 15:07   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #239

How to make this format.

Admin can see dead chat of both teams, but can't see their team chat no matter alive or dead.

Only Admin can see all chat, not a player but without team chat, never team chat.
Mergim is offline
kltar0
New Member
Join Date: Oct 2014
Old 08-28-2022 , 16:36   Re: Chat Manager [Admin Prefix & Color Chat]
Reply With Quote #240

Hi,

I use this plugin to show [Steam] prefix to players with steam.

Code:
#include <amxmodx>
#include <chatmanager>

#if !defined MAX_PLAYERS
	const MAX_PLAYERS = 32
#endif

#define STEAM_PREFIX "&x04[Steam]"

new bool:g_bIsSteam[MAX_PLAYERS + 1]

public plugin_init()
{
	register_plugin("CM: Steam Prefix", "1.0", "OciXCrom")
}

public client_authorized(id)
{
	g_bIsSteam[id] = is_user_steam(id)

	if(g_bIsSteam[id])
	{
		cm_on_player_data_updated(id)
	}
}

public cm_on_player_data_updated(id)
{
	if(g_bIsSteam[id])
	{
		cm_set_user_prefix(id, STEAM_PREFIX)
	}
}

bool:is_user_steam(id)
{
	static iPointer

	if(iPointer || (iPointer = get_cvar_pointer("dp_r_id_provider")))
	{
		server_cmd("dp_clientinfo %d", id)
		server_exec()

		return get_pcvar_num(iPointer) == 2
	}

	return false
}
My chat format in ini file is

Code:
format_admin = &x01*$level$* [&x04$rank$&x01] &x04$admin_prefix$ &x03$custom_name$ &x01: $chat_color$$message$
format_admin_team = &x01*($team$)* &x04[$rank$] $admin_prefix$ &x03$custom_name$ &x01: $chat_color$$message$
format_player = &x01*$level$* [&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
format_player_team = &x01*($team$)* &x04[$rank$] &x03$custom_name$ &x01: $chat_color$$message$
[Steam] prefix is show only for admins, but replace the default prefix set in the ini file for admins

I managed to show the [Steam] prefix for all players using the placeholder $admin_prefix$ in format_player and format_player_team

It is possible to show the [Steam] prefix using a new placeholder, to keep the existing $admin_prefix$ intact?

Thanks
kltar0 is offline
Reply


Thread Tools
Display Modes

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 01:02.


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