PHP- Kodu:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <nvault>

#define FLAG_LOAD ADMIN_CFG
#define MAX_FLAGS 33

new g_listeng_custom_currentg_custom_others;
new 
prefix_count 0prefix_collect[MAX_FLAGS][33], flag_listen[2], flag_custom_current[2], flag_custom_others[2], flags_collect[MAX_FLAGS][2], client_prefix[33][33];
new 
g_saytxtg_maxplayersg_nvault;
new 
g_typed[192], g_message[192], g_name[32], typed_prefix[33];

public 
plugin_init()
{
    
register_plugin("Admin Prefixes""1.0""m0skVi4a ;]")

    
g_listen register_cvar("ap_listen""0")
    
g_custom_current register_cvar("ap_custom_current""1")
    
g_custom_others register_cvar("ap_custom_others""1")

    
g_saytxt get_user_msgid ("SayText")
    
g_maxplayers get_maxplayers()
    
g_nvault nvault_open("CustomAdminPrefixes")

    
register_message(g_saytxt"DuplicateMessage")
    
register_concmd("ap_reloadfile""LoadFile")
    
register_concmd("ap_put""SetPrefix")
    
register_concmd("ap_put_player""SetPlayerPrefix")
    
register_clcmd("say""HookSay")
    
register_clcmd("say_team""HookSayTeam")

    
LoadFile(0)
}
    
public 
LoadFile(id)
{
    if(!(
get_user_flags(id) & FLAG_LOAD))
    {
        
console_print(id"[AdminPrefixes] You do not have the flag, needed for using this option!")
        return 
PLUGIN_HANDLED
    
}

    new 
config_dir[64], file[128], text[64], prefix[32], flags[2], lengthline 0;
    
prefix_count 0
    get_configsdir
(config_dircharsmax(config_dir))
    
formatex(filecharsmax(file), "%s/admin_prefixes.ini"config_dir)

    if(!
file_exists(file)) 
    {
        new 
error[256]
        
formatex(errorcharsmax(error), "[AdminPrefixes] Admin Prefix file - %s not found!"file)
        
set_fail_state(error)
    }

    while(
read_file(fileline textcharsmax(text), length) && prefix_count <= MAX_FLAGS)
    {
        if(!
text[0] || text[0] == '^n' || text[0] == ';')
        {
            
line++
            continue
        }

        
parse(textprefixcharsmax(prefix), flagscharsmax(flags))

        if(!
prefix[0] || !flags[0])
        {
            
line++
            continue
        }

        if(
equal(prefix"ADMIN_LISTEN"))
        {
            
flag_listen flags
            line
++
            continue
        }

        if(
equal(prefix"CUSTOM_CURRENT"))
        {
            
flag_custom_current flags
            line
++
            continue
        }

        if(
equal(prefix"CUSTOM_OTHERS"))
        {
            
flag_custom_others flags
            line
++
            continue
        }

        
replace_all(prefixcharsmax(prefix), "!g""^x04")
        
replace_all(prefixcharsmax(prefix), "!t""^x03")
        
replace_all(prefixcharsmax(prefix), "!n""^x01")

        
prefix_count++
        
prefix_collect[prefix_count] = prefix
        flags_collect
[prefix_count] = flags
        line
++
    }

    if(
flag_listen[0])
    {
        
server_print("[AdminPrefixes] LOADED: Listen Option for players with Flag:  %s"flag_listen)
    }
    if(
flag_custom_current[0])
    {
        
server_print("[AdminPrefixes] LOADED: Custom Prefix Option for players with Flag:  %s",  flag_custom_current)
    }
    if(
flag_custom_others[0])
    {
        
server_print("[AdminPrefixes] LOADED: Setting Custom Prefix Option for players with Flag:  %s"flag_custom_others)
    }
    if(
prefix_count 0)
    {
        for(new 
1<= prefix_counti++)
        {
            
server_print("[AdminPrefixes] LOADED: Prefix: %s for players with Flag:  %s"prefix_collect[i], flags_collect[i])
        }
    }
    else 
    {
        
server_print("[AdminPrefixes] No Prefixes were been found!")
    }

    
get_user_name(idg_namecharsmax(g_name))
    
server_print("[AdminPrefixes] Plugin's file was been loaded by %s"g_name)
    
console_print(id"[AdminPrefixes] Plugin's file was been loaded!")

    for(new 
1<= g_maxplayersi++)
    {
        
PutClientPrefix(i)
    }

    return 
PLUGIN_HANDLED
}

public 
client_connect(id)
{
    
client_prefix[id] = ""
    
set_task(1.0"PutClientPrefix"id)
}

public 
client_disconnect(id)
{
    
client_prefix[id] = ""
}

public 
PutClientPrefix(id)
{
    new 
nvault_prefix[33];
    
get_user_name(idg_namecharsmax(g_name))

    new 
data nvault_get(g_nvaultg_namenvault_prefixcharsmax(nvault_prefix))

    if(
data && get_pcvar_num(g_custom_current) && flag_custom_current[0] && get_user_flags(id) & read_flags(flag_custom_current))
    {
        
client_prefix[id] = nvault_prefix
    
}
    else
    {
        for(new 
1<= prefix_counti++)
        {
            if(
get_user_flags(id) & read_flags(flags_collect[i]))
            {
                
client_prefix[id] = prefix_collect[i]
            }
        }
    }
}

public 
DuplicateMessage(id)

    return 
PLUGIN_HANDLED
}

public 
HookSay(id)
{
    
read_args(g_typedcharsmax(g_typed))
    
remove_quotes(g_typed)

    if(
equal(g_typed""))
        return 
PLUGIN_CONTINUE

    get_user_name
(idg_namecharsmax(g_name))

    if(
client_prefix[id][0])
    {
        if(
is_user_alive(id))
        {
            
formatex(g_messagecharsmax(g_message), "^4%s^3 %s :^4 %s"client_prefix[id], g_nameg_typed)
        }
        else
        {
            
formatex(g_messagecharsmax(g_message), "^1*DEAD*^4 %s^3 %s :^4 %s"client_prefix[id], g_nameg_typed)
        }
    }
    else
    {
        if(
is_user_alive(id))
        {
            
formatex(g_messagecharsmax(g_message), "^3%s :^1 %s"g_nameg_typed)
        }
        else
        {
            
formatex(g_messagecharsmax(g_message), "^1*DEAD*^3 %s :^1 %s"g_nameg_typed)
        }
    }

    for(new 
1<= g_maxplayersi++)
    {
        if(!
is_user_connected(i))
            continue;

        if(
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i) || get_pcvar_num(g_listen) && flag_listen[0] && get_user_flags(i) & read_flags(flag_listen))
        {
            
message_begin(MSG_ONEg_saytxt, {000}, i)
            
write_byte(id)
            
write_string(g_message)
            
message_end()
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
HookSayTeam(id)
{
    new 
g_team[18];

    
read_args(g_typedcharsmax(g_typed))
    
remove_quotes(g_typed)

    if(
equal(g_typed""))
        return 
PLUGIN_CONTINUE

    get_user_name
(idg_namecharsmax(g_name))

    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
        {
            
g_team "Terrorist"
        
}
        case 
CS_TEAM_CT:
        {
            
g_team "Counter-Terrorist"
        
}
        default:
        {
            
g_team "Spectator"
        
}
    }

    if(
client_prefix[id][0])
    {
        if(
is_user_alive(id))
        {
            
formatex(g_messagecharsmax(g_message), "^1(%s)^4 %s^3 %s :^4 %s"g_teamclient_prefix[id], g_nameg_typed)
        }
        else
        {
            
formatex(g_messagecharsmax(g_message), "^1*DEAD* (%s)^4 %s^3 %s :^4 %s"g_teamclient_prefix[id], g_nameg_typed)
        }
    }
    else
    {
        if(
is_user_alive(id))
        {
            
formatex(g_messagecharsmax(g_message), "^1(%s)^3 %s :^1 %s"g_teamg_nameg_typed)
        }
        else
        {
            
formatex(g_messagecharsmax(g_message), "^1*DEAD* (%s)^3 %s :^1 %s"g_teamg_nameg_typed)
        }
    }

    for(new 
1<= g_maxplayersi++)
    {
        if(!
is_user_connected(i))
            continue

        if(
cs_get_user_team(id) == cs_get_user_team(i) || get_pcvar_num(g_listen) && flag_listen[0] && get_user_flags(i) & read_flags(flag_listen))
        {
            if(
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i) || get_pcvar_num(g_listen) && flag_listen[0] && get_user_flags(i) & read_flags(flag_listen))
            {
                
message_begin(MSG_ONEg_saytxt, {000}, i)
                
write_byte(id)
                
write_string(g_message)
                
message_end()
            }
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
SetPrefix(id
{
    if(!
get_pcvar_num(g_custom_current) || !flag_custom_current[0])
    {
        
console_print(id"[AdminPrefixes] This option is currently disabled!")
        return 
PLUGIN_HANDLED
    
}

    if(!(
get_user_flags(id) & read_flags(flag_custom_current)))
    {
        
console_print(id"[AdminPrefixes] You do not have the flag, needed for using this option!")
        return 
PLUGIN_HANDLED
    
}

    
read_args(typed_prefixcharsmax(typed_prefix))
    
remove_quotes(typed_prefix)
    
get_user_name(idg_namecharsmax(g_name))

    if(
equal(typed_prefix""))
    {
        
nvault_remove(g_nvaultg_name)
        
console_print(id"[AdminPrefix] You have successfully removed your prefix.")
        
server_print("[AdminPrefix] Player %s removed his prefix"g_name)
        
PutClientPrefix(id)
        return 
PLUGIN_HANDLED
    
}

    
replace_all(typed_prefixcharsmax(typed_prefix), "!g""^x04")
    
replace_all(typed_prefixcharsmax(typed_prefix), "!t""^x03")
    
replace_all(typed_prefixcharsmax(typed_prefix), "!n""^x01")

    
nvault_set(g_nvaultg_nametyped_prefix)
    
client_prefix[id] = typed_prefix

    console_print
(id"[AdminPrefix] You have successfully changed your prefix to  %s"typed_prefix)
    
server_print("[AdminPrefix] Player %s changed his prefix to  %s"g_nametyped_prefix

    return 
PLUGIN_HANDLED
}

public 
SetPlayerPrefix(id)
{
    if(!
get_pcvar_num(g_custom_current) || !flag_custom_current[0] || !get_pcvar_num(g_custom_others) || !flag_custom_others[0])
    {
        
console_print(id"[AdminPrefixes] This option is currently disabled!")
        return 
PLUGIN_HANDLED
    
}

    if(!(
get_user_flags(id) & read_flags(flag_custom_others)))
    {
        
console_print(id"[AdminPrefixes] You do not have the flag, needed for using this option!")
        return 
PLUGIN_HANDLED
    
}

    new 
name_tag[64], typed_name[32];

    
read_args(name_tagcharsmax(name_tag))
    
remove_quotes(name_tag)
    
parse(name_tagtyped_namecharsmax(typed_name), typed_prefixcharsmax(typed_prefix))
    
get_user_name(idg_namecharsmax(g_name))

    new 
target cmd_target(idtyped_name1)

    if(!
target)
        return 
PLUGIN_HANDLED

    
if(equal(typed_prefix""))
    {
        
nvault_remove(g_nvaulttyped_name)
        
console_print(id"[AdminPrefixes] You have successfully removed ^"%s^"'s prefix."typed_name)
        
server_print("[AdminPrefixes] Player %s removed ^"%s^"'s prefix"g_nametyped_name)
        
PutClientPrefix(target)
        return 
PLUGIN_HANDLED
    
}

    
replace_all(typed_prefixcharsmax(typed_prefix), "!g""^x04")
    
replace_all(typed_prefixcharsmax(typed_prefix), "!t""^x03")
    
replace_all(typed_prefixcharsmax(typed_prefix), "!n""^x01")    

    
nvault_set(g_nvaulttyped_nametyped_prefix)
    
client_prefix[target] = typed_prefix

    console_print
(id"[AdminPrefixes] You have successfully changed ^"%s^"'s prefix to  %s"typed_nametyped_prefix)
    
server_print("[AdminPrefixes] Player %s changed ^"%s^"'s prefix to  %s"g_nametyped_nametyped_prefix

    return 
PLUGIN_HANDLED

admin_prefixes.ini
Kod:
ADMIN_LISTEN l
CUSTOM_CURRENT l
CUSTOM_OTHERS l

"[Revenqe ` # Slot]" "b"
"[Revenqe ` # Admin]" "c"
"[Revenqe ` # VIP]" "l"
"[Revenqe ` # Kaptan]" "k"
b yetkisi olup c,l,k olmayana SLOT
c yetkisi olup l ve k olmayana Admin
l yetkisi olup k olmayana VIP
k yetkisi olana Kaptan