Помощ с плъгина Rank System & Admin Prefix

Въпроси и проблеми свързани с AMXModX.
Заключено
Аватар
Invius
Извън линия
Модератор
Модератор
Мнения: 1531
Регистриран на: 27 Ное 2016, 17:47
Местоположение: Invius.eu
Се отблагодари: 103 пъти
Получена благодарност: 247 пъти
Обратна връзка:

Помощ с плъгина Rank System & Admin Prefix

Мнение от Invius » 06 Юли 2017, 21:27

Здравейте,

Пробвах да добавя нов префикс - SMS Admin, но в плъгина показва грешка, ако може да я поправите. Благодаря предварително.

Код:

Код за потвърждение: Избери целия код

#include             <amxmodx>
#include             <amxmisc>
#include             <cstrike>
#include             <fvault>
#include             <colorchat>
#include             <fakemeta>
#include            <fakemeta_util>
#include             <fun>
#include             <hamsandwich>

#define ADMIN_ONE        ADMIN_LEVEL_H  //Head Admin префикс "t"
#define ADMIN_TWO        ADMIN_CVAR  //Moderator префикс "g"
#define ADMIN_THREE        ADMIN_LEVEL_A  //Global Admin префикс "m"
#define ADMIN_FOUR        ADMIN_CFG  //Server Support префикс "h"
#define ADMIN_FIVE        ADMIN_BAN  //Server Admin префикс "d"
#define ADMIN_SIX        ADMIN_KICK  //Test Admin префикс "c"
#define ADMIN_SEVEN        ADMIN_IMMUNITY  //SMS Admin префикс "a"

#define MaxLevels         21
#define IsPlayer(%1)         (1 <= %1 <=  g_iMaxPlayers)

new MaxPlayers, syncObj, Lvl[33], XP[33], iPrefix
new ranks_hud, knife_xp, he_xp, hs_xp, kill_xp, suicide_xp, killer_msg
new UseAdminPrefixes, UseRankSystem, UseBoth
new HUDR,HUDG,HUDB,HUDX,HUDY, HUDEFFECT
new sayText, teamInfo, szArgs[192], temp_flag[2]
new Vip, VipFlag

new const g_vault_name[] = "ranks";

new const Levels[MaxLevels] =
{
0,
50,
100,
150,
300,
350,
400,
500,
550,
650,
700,
800,
825,
850,
890,
990,
1100,
1200,
1500,
1700,
2500
}

new const Prefix[MaxLevels][] =
{
"Novak",
"Ubiec",
"Super Ubiec",
"Spider-Man",
"MasteR",
"SuperMan",
"Mashina",
"Pro Igrach",
"HeadShot Mashina",
"Nenadminat",
"SuperNova",
"Ekspert Igrach",
"Assasin",
"Super MasteR",
"MonsteR",
"Vendetta",
"Matrix",
"Dragon",
"Agent 007",
"Equilibrium",
"TerminatoR"
}

new const szTag[][] = {
    "",
    "Head Admin",
    "Moderator",
    "Global Amdin",
    "Server Support",
    "Server Admin",
    "Test Admin",
    "SMS Admin"
}

public plugin_init()
{
    register_plugin("Admin Prefixes & Rank System", "1.0", "ajw1337");
    
    register_clcmd ("say", "hook_say")
    register_clcmd ("say_team", "hook_teamsay")
    
    Vip = register_cvar("Vip_On/Off", "1")  //Вип настройката "1" включено "0" изключено.
    VipFlag = register_cvar("Vip_Flag", "t")  //Вип флага. (В момента е t) 
    
    register_event("DeathMsg","DeathMessage","a")
    
    register_clcmd("say /myrank", "cmdRank")
    register_clcmd("say_team /myrank", "cmdRank")
    register_clcmd("say /xp", "cmdRank")
    register_clcmd("say_team /xp", "cmdRank")

    UseAdminPrefixes = register_cvar("Admin_Prefixes_On/Off", "0")  //Админ префикса. 1 включено "0" изключено.
    UseRankSystem = register_cvar("Rank_Prefixes_On/Off", "0")  //Ранк системата "1" включено "0" изключено.
    UseBoth = register_cvar("Use_Both_AdminPrefix_Rank", "1")  //Ранк системата, и админ префикса. "1" включено "0" изключено
    
    ranks_hud = register_cvar("ranks_hud", "1")  //Ранк HUD съобщение.
    iPrefix = register_cvar("rank_prefix", "FunServ.EU");  //Префикса на системата.
    knife_xp = register_cvar("knife_xp", "5")  //Колко XP да дава като го убиеш с ножа.
    he_xp = register_cvar("he_grenade_xp", "2") //Колко XP да дава като го убиеш с граната.
    hs_xp = register_cvar("headshot_xp", "10")  //Колко XP да дава като го убиеш с HeadShoot
    kill_xp = register_cvar("kill_xp", "3")  //Колко XP да дава като го убиеш.
    suicide_xp = register_cvar("suicide_xp", "3")  //Колко XP да вземе като се самоубиеш
    killer_msg = register_cvar("kill_message", "1")  //Да излиза ли съобщението когато го убиеш противник.
    
    
    HUDR = register_cvar("hud_color_red", "139")
    HUDG = register_cvar("hud_color_green", "0")
    HUDB = register_cvar("hud_color_blue", "139")
    HUDX = register_cvar("hud_position_X", "0.01")
    HUDY = register_cvar("hud_position_Y", "0.14")
    HUDEFFECT = register_cvar("hud_effects", "0")
    
    sayText = get_user_msgid("SayText")
    teamInfo = get_user_msgid("TeamInfo")
    register_message(sayText, "avoid_duplicated")
    
    
    register_concmd ("amx_give_xp", "CmdAddXP", ADMIN_BAN, "<nick | ct | t | @all> <xp>")
    register_concmd ("amx_take_xp", "CmdRemoveXP", ADMIN_BAN, "<nick | ct | t | @all> <xp>")
    
    register_forward( FM_ClientKill, "Fwd_Kill" );
    
    MaxPlayers = get_maxplayers()

    syncObj = CreateHudSyncObj()

    fvault_load(g_vault_name)
}
public getPrefix()
{
    new Prefix[33]
    get_pcvar_string(iPrefix, Prefix, 32)
    return Prefix
}
public ShowHud(id)
{
set_hudmessage(get_pcvar_num(HUDR), get_pcvar_num(HUDG), get_pcvar_num(HUDB), get_pcvar_float(HUDX), get_pcvar_float(HUDY), get_pcvar_num(HUDEFFECT), 6.0, 1.0, 0.0, 0.0, -1)
if(MaxLevels == Lvl[id]+1)
ShowSyncHudMsg(id, syncObj,"Rank: %s^nXP: %d", Prefix[Lvl[id]], XP[id])
else
ShowSyncHudMsg(id, syncObj,"Rank: %s/%s^nXP: %d/%d",Prefix[Lvl[id]], Prefix[Lvl[id]+1], XP[id], Levels[Lvl[id]+1])
}
public cmdRank(id)
{
    if(MaxLevels == Lvl[id]+1)
        ColorChat(id, NORMAL, "^4[%s]^3 My Rank^1:^4 %s^1 | ^3Level^1: ^4%d ^1| ^3XP^1: ^4%d^1.", getPrefix(), Prefix[Lvl[id]], Lvl[id]+1, XP[id])
    else
        ColorChat(id, NORMAL, "^4[%s]^3 My Rank^1:^4 %s^1 | ^3Level^1: ^4%d ^1/ ^4%d ^1| ^3XP^1: ^4 %d ^1/ ^4%d ^1to become ^4%s^1.",getPrefix(), Prefix[Lvl[id]], Lvl[id]+1, MaxLevels, XP[id], Levels[Lvl[id]+1], Prefix[Lvl[id]+1])
}

public client_putinserver(id)
{
if(get_pcvar_num(ranks_hud) == 1)
set_task(1.0, "ShowHud", id, _, _, "b")

new currentPlayerRank = 0;
while(currentPlayerRank < (MaxLevels - 1))
{       
    if(XP[id] >= Levels[currentPlayerRank + 1])
        ++currentPlayerRank;     
    else         
        break;
}
Lvl[id] = currentPlayerRank;
}
public Fwd_Kill(id)
{
    if(is_user_alive(id)) {
        XP[id] -= get_pcvar_num(suicide_xp)
        CheckLevel(id) 
        Save(id)
        if(get_pcvar_num(killer_msg) == 1)
            ColorChat(id, RED, "^4[%s]^1 You committed ^3suicide ^1and ^3lost^4 %d XP^1.", getPrefix(),  get_pcvar_num(suicide_xp))

            
        return PLUGIN_CONTINUE
    }
    return PLUGIN_CONTINUE
}

public DeathMessage()
{       
    new killer = read_data(1);
    new victim = read_data(2);
    new headshot = read_data(3);
    new Weapon[ 32 ];
    read_data( 4, Weapon, charsmax( Weapon ) );
    
    format( Weapon, charsmax( Weapon ), "weapon_%s", Weapon );
    
    if( contain( Weapon, "nade" ) >= 0 )
    Weapon = "weapon_hegrenade"
    
    
    new iWeapon = get_weaponid( Weapon );
    
    if(killer == victim)
        return PLUGIN_CONTINUE;
    if(!killer || killer > MaxPlayers)
        return PLUGIN_CONTINUE;
    
    new victim_name[32];
    get_user_name(victim, victim_name, 31);
    
    get_pcvar_string(VipFlag, temp_flag, charsmax(temp_flag));
    
    
    if(iWeapon == CSW_HEGRENADE)
    {
    
        if(get_pcvar_num(Vip) == 1 && get_user_flags(killer) & read_flags(temp_flag)) {
            XP[killer] += get_pcvar_num(he_xp)*2
            CheckLevel(killer)
            Save(killer)
            if(get_pcvar_num(killer_msg) == 1) {
                ColorChat(killer, RED, "^4[%s]^1 You killed ^4%s^1 with ^3HE Grenade^1 and get^4 %d XP^1. [ ^4vip bonus: yes ^1]", getPrefix(),victim_name,  get_pcvar_num(he_xp)*2)
                return PLUGIN_CONTINUE
            }
        } else {
            XP[killer] += get_pcvar_num(he_xp)
            CheckLevel(killer)
            Save(killer)
            if(get_pcvar_num(killer_msg) == 1){
                ColorChat(killer, RED, "^4[%s]^1 You killed ^4%s^1 with ^3HE Grenade^1 and get^4 %d XP^1. [ ^3vip bonus: no ^1]", getPrefix(),victim_name,  get_pcvar_num(he_xp))
                return PLUGIN_CONTINUE
            }
        }
    }
    if(iWeapon == CSW_KNIFE)
    {
        if(get_pcvar_num(Vip) == 1 && get_user_flags(killer) & read_flags(temp_flag)) {
            XP[killer] += get_pcvar_num(knife_xp)*2
            CheckLevel(killer)
            Save(killer)
            if(get_pcvar_num(killer_msg) == 1) {
                ColorChat(killer, RED, "^4[%s]^1 You killed ^4%s^1 with ^3Knife^1 and get^4 %d XP^1. [ ^4vip bonus: yes ^1]", getPrefix(),victim_name,  get_pcvar_num(knife_xp)*2)
                return PLUGIN_CONTINUE
            }
        } else {
            XP[killer] += get_pcvar_num(knife_xp)
            CheckLevel(killer)
            Save(killer)
            if(get_pcvar_num(killer_msg) == 1){
                ColorChat(killer, GREY, "^4[%s]^1 You killed ^4%s^1 with ^3Knife^1 and get^4 %d XP^1.[ ^3vip bonus: no ^1]", getPrefix(),victim_name, get_pcvar_num(knife_xp))
                return PLUGIN_CONTINUE
            }
        }
    }
    
    
    if(headshot)
    {
        if(get_pcvar_num(Vip) == 1 && get_user_flags(killer) & read_flags(temp_flag)) {
            XP[killer] += get_pcvar_num(hs_xp)*2
            CheckLevel(killer)
            Save(killer)
            if(get_pcvar_num(killer_msg) == 1){
                ColorChat(killer, BLUE, "^4[%s]^1 You killed ^4%s^1 with ^3Head^4Shot^1 and get^4 %d XP^1.[ ^4vip bonus: yes ]", getPrefix(),victim_name, get_pcvar_num(hs_xp)*2)
                return PLUGIN_CONTINUE
            }
        } else {
            XP[killer] += get_pcvar_num(hs_xp)
            CheckLevel(killer)
            Save(killer)
            if(get_pcvar_num(killer_msg) == 1) {
                ColorChat(killer, BLUE, "^4[%s]^1 You killed ^4%s^1 with ^3Head^4Shot^1 and get^4 %d XP^1.[ ^3vip bonus: no ^1]", getPrefix(),victim_name, get_pcvar_num(hs_xp))
                return PLUGIN_CONTINUE
            }
        }
    }
    else
    {
        if(get_pcvar_num(Vip) == 1 && get_user_flags(killer) & read_flags(temp_flag)) {
            XP[killer] += get_pcvar_num(kill_xp)*2
            CheckLevel(killer)
            Save(killer)
            if(get_pcvar_num(killer_msg) == 1) {
                ColorChat(killer, NORMAL, "^4[%s]^1 You killed ^4%s^1 and get^4 %d XP^1.[ ^4vip bonus: yes ^1]", getPrefix(),victim_name, get_pcvar_num(kill_xp)*2)
                return PLUGIN_CONTINUE
            }
        } else {
        XP[killer] += get_pcvar_num(kill_xp)
        CheckLevel(killer)
        Save(killer)
        if(get_pcvar_num(killer_msg) == 1){
            ColorChat(killer, RED, "^4[%s]^1 You killed ^4%s^1 and get^4 %d XP^1.[ ^3vip bonus: no ]", getPrefix(),victim_name, get_pcvar_num(kill_xp))
            return PLUGIN_CONTINUE
            }
        }
    }
    CheckLevel(killer)
    Save(killer)
    return PLUGIN_CONTINUE
}

public CheckLevel(id)
{        
    new currentPlayerRank = 0;
    while(currentPlayerRank < (MaxLevels - 1))
    {       
        if(XP[id] >= Levels[currentPlayerRank + 1])
            ++currentPlayerRank;     
        else         
            break;
    }
    Lvl[id] = currentPlayerRank;
}

public client_connect(id)
{
    Load(id)
}


public client_disconnect(id)
{
    Save(id)
    XP[id] = 0
    Lvl[id] = 0
    remove_task(id)
}

public CmdAddXP (index, level, cid)
{
    if(!cmd_access(index, level, cid, 3)) return PLUGIN_HANDLED;
    
    new arg [32]
    read_argv (1, arg, 31)
    
    new AddXP [32]
    read_argv (2, AddXP, charsmax (AddXP))
    
    new XPtoGive = str_to_num (AddXP)
    
    new AdminName [32]
    new TargetName [32]
    get_user_name (index, AdminName, charsmax (AdminName))
    
    if(arg[0]=='@')
    {
        if(equali(arg[1],"All") || equali(arg[1],"ALL"))
        {
            new players[32], totalplayers, All
            get_players(players, totalplayers)
            
            for (new i = 0; i < totalplayers; i++)
            {
                All = players[i]
                
                XP[All] += XPtoGive
            }
            
            CheckLevel(All)
            ColorChat(0, NORMAL, "^4[%s] ^1ADMIN: ^3%s^1 gave^4 %i XP^1 to everyone!", getPrefix(), AdminName, XPtoGive)
        }
        else if(equali(arg[1],"T") || equali(arg[1],"t"))
        {
            new players[32], totalplayers, T
            get_players(players, totalplayers)
            
            for (new i = 0; i < totalplayers; i++)
            {
                if (get_user_team(players[i]) == 1)
                {
                    T = players[i]
                    
                    XP[T] += XPtoGive
                }
            }
            
            CheckLevel(T)
            ColorChat(0, RED, "^4[%s]^1 ADMIN: ^4%s ^1gave ^4%i XP ^1to all ^3Terrorists^1.", getPrefix(), AdminName, XPtoGive)
        }
        else if(equali(arg[1],"CT") || equali(arg[1],"ct"))
        {
            new players[32], totalplayers, CT
            get_players(players, totalplayers)
            
            for(new i = 0; i < totalplayers; i++)
            {
                if(get_user_team(players[i]) == 2)
                {
                    CT = players[i]
                    
                    XP[CT] += XPtoGive
                }
            }
            
            CheckLevel(CT)
            ColorChat(0, BLUE, "^4[%s]^1ADMIN: ^4%s^1 gave^4 %i XP^1to all ^3Counter-Terrorists^1.", getPrefix(), AdminName, XPtoGive)
        }
    }
    else
    {
        new iTarget = cmd_target(index, arg, 3)
        get_user_name (iTarget, TargetName, charsmax (TargetName))
        
        if(iTarget)
        {
            XP[iTarget] += XPtoGive
            
            CheckLevel(iTarget)
            ColorChat(0, NORMAL, "^4[%s]^1 ADMIN: ^3%s^1 gave^4 %i XP^1 to^4 %s^1.", getPrefix(), AdminName, XPtoGive, TargetName)
        }
    }
    return PLUGIN_HANDLED
}
public CmdRemoveXP (index, level, cid)
{
    if(!cmd_access(index, level, cid, 3)) return PLUGIN_HANDLED;
    
    new arg [32]
    read_argv (1, arg, 31)
    
    new RemoveXP [32]
    read_argv (2, RemoveXP, charsmax (RemoveXP))
    
    new XPtoTook = str_to_num (RemoveXP)
    
    new AdminName [32]
    new TargetName [32]
    get_user_name (index, AdminName, charsmax (AdminName))
    
    if(arg[0]=='@')
    {
        if(equali(arg[1],"All") || equali(arg[1],"ALL"))
        {
            new players[32], totalplayers, All
            get_players(players, totalplayers)
            
            for (new i = 0; i < totalplayers; i++)
            {
                All = players[i]
                
                XP[All] -= XPtoTook
            }
            
            CheckLevel(All)
            ColorChat(0, NORMAL, "^4[%s] ^1ADMIN: ^3%s^1 took^4 %i XP^1 from everyone!", getPrefix(), AdminName, XPtoTook)
        }
        else if(equali(arg[1],"T") || equali(arg[1],"t"))
        {
            new players[32], totalplayers, T
            get_players(players, totalplayers)
            
            for (new i = 0; i < totalplayers; i++)
            {
                if (get_user_team(players[i]) == 1)
                {
                    T = players[i]
                    
                    XP[T] -= XPtoTook
                }
            }
            
            CheckLevel(T)
            ColorChat(0, RED, "^4[%s]^1 ADMIN: ^4%s ^1took ^4%i XP ^1from all ^3Terrorists^1.", getPrefix(), AdminName, XPtoTook)
        }
        else if(equali(arg[1],"CT") || equali(arg[1],"ct"))
        {
            new players[32], totalplayers, CT
            get_players(players, totalplayers)
            
            for(new i = 0; i < totalplayers; i++)
            {
                if(get_user_team(players[i]) == 2)
                {
                    CT = players[i]
                    
                    XP[CT] -= XPtoTook
                }
            }
            
            CheckLevel(CT)
            ColorChat(0, BLUE, "^4[%s]^1ADMIN: ^4%s^1 took^4 %i XP^1from all ^3Counter-Terrorists^1.", getPrefix(), AdminName, XPtoTook)
        }
    }
    else
    {
        new iTarget = cmd_target(index, arg, 3)
        get_user_name (iTarget, TargetName, charsmax (TargetName))
        
        if(iTarget)
        {
            XP[iTarget] -= XPtoTook
            
            CheckLevel(iTarget)
            ColorChat(0, NORMAL, "^4[%s]^1 ADMIN: ^3%s^1 took^4 %i XP^1 from^4 %s^1.", getPrefix(), AdminName, XPtoTook, TargetName)
        }
    }
    return PLUGIN_HANDLED
}

public avoid_duplicated(msgId, msgDest, receiver)
{
    return PLUGIN_HANDLED
}

public hook_say(id)
{
if(!is_user_connected(id)) {
    return PLUGIN_HANDLED_MAIN
}

read_args(szArgs, 191)
remove_quotes(szArgs)
    
// Gungame commands and empty messages
if(szArgs[0] == '@' || szArgs[0] == '/' || szArgs[0] == '!' || szArgs[0] == '#' || szArgs[0] == '$' || equal(szArgs, "")) // Ignores Admin Hud Messages, Admin Slash commands
    return PLUGIN_CONTINUE

new iAlive = is_user_alive(id)
new CsTeams:iTeam = cs_get_user_team(id)

new iPlayers[ 32 ], iNum
get_players(iPlayers, iNum)

new szName[32]
get_user_name(id, szName, sizeof szName-1)

new const szPrefixes[2][CsTeams][] = {
{
    "^1*DEAD* ",
    "^1*DEAD* ",
    "^1*DEAD* ",
    "^1*SPEC* "
},
{
    "",
    "",
    "",
    ""
}
}
if(get_pcvar_num(UseAdminPrefixes) == 1){

set_pcvar_num(UseRankSystem, 0)
set_pcvar_num(UseBoth, 0)

new iAdmin = 0, iFlags = get_user_flags(id)

if(iFlags & ADMIN_ONE)
                iAdmin = 1
else if(iFlags & ADMIN_TWO)
                iAdmin = 2
else if(iFlags & ADMIN_THREE)
                iAdmin = 3
else if(iFlags & ADMIN_FOUR)
                iAdmin = 4
else if(iFlags & ADMIN_FIVE)
                iAdmin = 5
else if(iFlags & ADMIN_SIX)
                iAdmin = 6
else if(iFlags & ADMIN_SEVEN)
                iAdmin = 7

    
    
if(iFlags & ADMIN_ONE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_TWO) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_THREE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FOUR) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FIVE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_SIX) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
if(iFlags & ADMIN_SEVEN) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else {
if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
}else if(cs_get_user_team(id) == CS_TEAM_T) {
    ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
    }
}

return PLUGIN_HANDLED_MAIN
}

if(get_pcvar_num(UseRankSystem) == 1){
    
set_pcvar_num(UseAdminPrefixes, 0)
set_pcvar_num(UseBoth, 0)
    
new iFlags = get_user_flags(id)
    
if(iFlags & ADMIN_ONE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_TWO) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_THREE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FOUR) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FIVE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_SIX) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
if(iFlags & ADMIN_SEVEN) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else {
if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
}else if(cs_get_user_team(id) == CS_TEAM_T) {
    ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
    }
}

return PLUGIN_HANDLED_MAIN
}

if(get_pcvar_num(UseBoth) == 1){
    
set_pcvar_num(UseAdminPrefixes, 0)
set_pcvar_num(UseRankSystem, 0)
    
new iAdmin = 0, iFlags = get_user_flags(id)

if(iFlags & ADMIN_ONE)
                iAdmin = 1
else if(iFlags & ADMIN_TWO)
                iAdmin = 2
else if(iFlags & ADMIN_THREE)
                iAdmin = 3
else if(iFlags & ADMIN_FOUR)
                iAdmin = 4
else if(iFlags & ADMIN_FIVE)
                iAdmin = 5
else if(iFlags & ADMIN_SIX)
                iAdmin = 6
else if(iFlags & ADMIN_SEVEN)
                iAdmin = 7

    
    
if(iFlags & ADMIN_ONE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_TWO) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_THREE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FOUR) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FIVE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_SIX) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
if(iFlags & ADMIN_SEVEN) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^1[^4%s^1] ^3[^4%s^3] ^3%s : ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
}  else {
if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, BLUE, "%s^1[^4%s^1] ^3%s : ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
}else if(cs_get_user_team(id) == CS_TEAM_T) {
    ColorChat(0, RED, "%s^1[^4%s^1] ^3%s : ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
    }
}
return PLUGIN_HANDLED_MAIN
}

if(get_pcvar_num(UseAdminPrefixes) == 0 && get_pcvar_num(UseRankSystem) == 0 && get_pcvar_num(UseBoth) == 0)
{
    if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, NORMAL, "%s^3%s^1: %s", szPrefixes[iAlive][iTeam], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, NORMAL, "%s^3%s^1: %s", szPrefixes[iAlive][iTeam],szName, szArgs)
    }
    
}
return PLUGIN_HANDLED_MAIN
}

public hook_teamsay(id) {
if(!is_user_connected(id)) {
    return PLUGIN_HANDLED_MAIN
}

read_args(szArgs, 191)
remove_quotes(szArgs)
    
// Gungame commands and empty messages
if(szArgs[0] == '@' || szArgs[0] == '/' || szArgs[0] == '!' || szArgs[0] == '#' || szArgs[0] == '$' || equal(szArgs, "")) // Ignores Admin Hud Messages, Admin Slash commands
    return PLUGIN_CONTINUE

new iAlive = is_user_alive(id)
new CsTeams:iTeam = cs_get_user_team(id)

new iPlayers[32], iNum
get_players(iPlayers, iNum)

new szName[32]
get_user_name(id, szName, sizeof szName-1)

new const szPrefixes[2][CsTeams][] = {
{
    "^3(Spectator) ",
    "^1*DEAD* ^3(Terrorist) ",
    "^1*DEAD* ^3(Counter-Terrorist) ",
    "^3(Spectator) "
},
{
"^3(Spectator) ",
"^3(Terrorist) ",
"^3(Counter-Terrorist) ",
"^3(Spectator) "
}
}
if(get_pcvar_num(UseAdminPrefixes) == 1){

set_pcvar_num(UseRankSystem, 0)
set_pcvar_num(UseBoth, 0)

new iAdmin = 0, iFlags = get_user_flags(id)

if(iFlags & ADMIN_ONE)
                iAdmin = 1
else if(iFlags & ADMIN_TWO)
                iAdmin = 2
else if(iFlags & ADMIN_THREE)
                iAdmin = 3
else if(iFlags & ADMIN_FOUR)
                iAdmin = 4
else if(iFlags & ADMIN_FIVE)
                iAdmin = 5
else if(iFlags & ADMIN_SIX)
                iAdmin = 6
else if(iFlags & ADMIN_SEVEN)
                iAdmin = 7

    
    
if(iFlags & ADMIN_ONE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_TWO) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_THREE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FOUR) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FIVE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_SIX) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
if(iFlags & ADMIN_SEVEN) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],szTag[iAdmin], szName, szArgs)
    }
} else {
if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^4: ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
}else if(cs_get_user_team(id) == CS_TEAM_T) {
    ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^4: ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
    }
}

return PLUGIN_HANDLED_MAIN
}

if(get_pcvar_num(UseRankSystem) == 1){
    
set_pcvar_num(UseAdminPrefixes, 0)
set_pcvar_num(UseBoth, 0)
    
new iFlags = get_user_flags(id)
    
if(iFlags & ADMIN_ONE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_TWO) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_THREE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FOUR) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FIVE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_SIX) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
if(iFlags & ADMIN_SEVEN) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam],Prefix[Lvl[id]], szName, szArgs)
    }
} else {
if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^4: ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
}else if(cs_get_user_team(id) == CS_TEAM_T) {
    ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^4: ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
    }
}

return PLUGIN_HANDLED_MAIN
}

if(get_pcvar_num(UseBoth) == 1){
    
set_pcvar_num(UseAdminPrefixes, 0)
set_pcvar_num(UseRankSystem, 0)
    
new iAdmin = 0, iFlags = get_user_flags(id)

if(iFlags & ADMIN_ONE)
                iAdmin = 1
else if(iFlags & ADMIN_TWO)
                iAdmin = 2
else if(iFlags & ADMIN_THREE)
                iAdmin = 3
else if(iFlags & ADMIN_FOUR)
                iAdmin = 4
else if(iFlags & ADMIN_FIVE)
                iAdmin = 5
else if(iFlags & ADMIN_SIX)
                iAdmin = 6
else if(iFlags & ADMIN_SEVEN)
                iAdmin = 7

    
    
if(iFlags & ADMIN_ONE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_TWO) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_THREE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FOUR) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_FIVE) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else 
if(iFlags & ADMIN_SIX) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
if(iFlags & ADMIN_SEVEN) {
    if(cs_get_user_team(id) == CS_TEAM_CT) {
        ColorChat(0, BLUE, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, RED, "%s^3[^4%s^3] ^3[^4%s^3] ^3%s^1: ^4%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szTag[iAdmin], szName, szArgs)
    }
} else {
if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, BLUE, "%s^3[^4%s^3] ^3%s^4: ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
}else if(cs_get_user_team(id) == CS_TEAM_T) {
    ColorChat(0, RED, "%s^3[^4%s^3] ^3%s^4: ^1%s", szPrefixes[iAlive][iTeam], Prefix[Lvl[id]], szName, szArgs)
    }
}
return PLUGIN_HANDLED_MAIN
}

if(get_pcvar_num(UseAdminPrefixes) == 0 && get_pcvar_num(UseRankSystem) == 0 && get_pcvar_num(UseBoth) == 0)
{
    if(cs_get_user_team(id) == CS_TEAM_CT) {
    ColorChat(0, NORMAL, "%s^3%s^1: %s", szPrefixes[iAlive][iTeam], szName, szArgs)
    } else if(cs_get_user_team(id) == CS_TEAM_T) {
        ColorChat(0, NORMAL, "%s^3%s^1: %s", szPrefixes[iAlive][iTeam],szName, szArgs)
    }
    
}
return PLUGIN_HANDLED_MAIN
}

public Save(id)
{
    new name[32];
    get_user_name(id,name,31);
    new vaultkey[64],vaultdata[256];
    
    format(vaultkey,63,"%s", name);
    format(vaultdata,255,"%i#%i#",XP[id],Lvl[id]);
    fvault_set_data(g_vault_name,vaultkey,vaultdata);
    
    return PLUGIN_CONTINUE;
}
public Load(id)
{
    new name[32];
    get_user_name(id,name,31);
    new vaultkey[64],vaultdata[256];
    
    format(vaultkey,63,"%s",name);
    format(vaultdata,255,"%i#%i#",XP[id],Lvl[id]);
    fvault_get_data(g_vault_name,vaultkey,vaultdata,charsmax(vaultdata));
    
    replace_all(vaultdata, 255, "#", " ");
    new playerxp[32], playerlevel[32];
    parse(vaultdata, playerxp, 31, playerlevel, 31);
    
    XP[id] = str_to_num(playerxp);
    Lvl[id] = str_to_num(playerlevel);
    
    return PLUGIN_CONTINUE;
}
public changeTeamInfo(player, team[])
{
    message_begin(MSG_ONE, teamInfo, _, player)    // Tells to to modify teamInfo(Which is responsable for which time player is)
    write_byte(player)                // Write byte needed
    write_string(team)                // Changes player's team
    message_end()                    // Also Needed
}

public writeMessage(player, szArgs[])
{
    message_begin(MSG_ONE, sayText, {0, 0, 0}, player)    // Tells to modify sayText(Which is responsable for writing colored messages)
    write_byte(player)                    // Write byte needed
    write_string(szArgs)                    // Effectively write the message, finally, afterall
    message_end()                        // Needed as always
}
Последно промяна от Invius на 06 Юли 2017, 21:36, променено общо 1 път.
INVIUS.EU
ИЗРАБОТВАНЕ НА УЕБ ДИЗАЙНИ, УЕБ СИСТЕМИ И PHOTOSHOP УСЛУГИ
Сайт - https://invius.eu/home/
Продукти - https://invius.eu/categories/
Регистация в системата - https://invius.eu/register/
Изображение
Изображение

Аватар
SorryMateYoureDead
Извън линия
Потребител
Потребител
Мнения: 203
Регистриран на: 21 Май 2017, 17:40
Местоположение: Sliven
Се отблагодари: 3 пъти
Получена благодарност: 1 път
Обратна връзка:

Re: Помощ с плъгина Rank System & Admin Prefix

Мнение от SorryMateYoureDead » 06 Юли 2017, 21:29

Този е от бъгавите , и изисква доста редакции за един ранг ! Ползвай този на OciX или купи от мен 1!
DARKNESS-CS

Order MOD

The GODs here OciXCrom & WaLkZ !
Special thanks to them for the good work!

Аватар
Invius
Извън линия
Модератор
Модератор
Мнения: 1531
Регистриран на: 27 Ное 2016, 17:47
Местоположение: Invius.eu
Се отблагодари: 103 пъти
Получена благодарност: 247 пъти
Обратна връзка:

Re: Помощ с плъгина Rank System & Admin Prefix

Мнение от Invius » 06 Юли 2017, 21:32

SorryMateYoureDead написа:Този е от бъгавите , и изисква доста редакции за един ранг ! Ползвай този на OciX или купи от мен 1!
За мен няма значение какъв е, стига да ми върши работа. А ти нямаше смисъл да го пишеш този безсмислен коментар, ако съм решил да купувам щях да закупя, просто не ми трябва. Някой да помогне, а не да пише безсмислени коментари?
INVIUS.EU
ИЗРАБОТВАНЕ НА УЕБ ДИЗАЙНИ, УЕБ СИСТЕМИ И PHOTOSHOP УСЛУГИ
Сайт - https://invius.eu/home/
Продукти - https://invius.eu/categories/
Регистация в системата - https://invius.eu/register/
Изображение
Изображение

Аватар
DaRk_StyLe
Извън линия
AMXX Скриптър
AMXX Скриптър
Мнения: 264
Регистриран на: 26 Окт 2016, 12:40
Се отблагодари: 11 пъти
Получена благодарност: 30 пъти

Re: Помощ с плъгина Rank System & Admin Prefix

Мнение от DaRk_StyLe » 07 Юли 2017, 08:09

► Покажи скъсения текст
Би ли споменал каква грешка ти дава, за да се опитам да помогна по-бързо? На пръв поглед забелязвам, че навсякъде си използвал само if() проверка, а трябва да е else if(), както е при останалите префикси.

Виж дали така ще стане номерът. Затворих някои функции и малко от малко подредих кода. Не знам дали се компилира, не ми се занимава да търся colorchat библиотеката.
► Покажи скъсения текст

Аватар
Invius
Извън линия
Модератор
Модератор
Мнения: 1531
Регистриран на: 27 Ное 2016, 17:47
Местоположение: Invius.eu
Се отблагодари: 103 пъти
Получена благодарност: 247 пъти
Обратна връзка:

Re: Помощ с плъгина Rank System & Admin Prefix

Мнение от Invius » 07 Юли 2017, 12:48

Ключ.
INVIUS.EU
ИЗРАБОТВАНЕ НА УЕБ ДИЗАЙНИ, УЕБ СИСТЕМИ И PHOTOSHOP УСЛУГИ
Сайт - https://invius.eu/home/
Продукти - https://invius.eu/categories/
Регистация в системата - https://invius.eu/register/
Изображение
Изображение

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Поддръжка / Помощ”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 5 госта