Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

translit_with_chat_colors

, Помощь
nastia777
сообщение 22.7.2014, 21:56
Сообщение #1
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

Кто может переделать немного плагин, бесплатно или за скромную сумму !

нужно убрать убрать русский транслит он не нужен
и что бы в чате была приставка [Admin] ник
всем спасибо !

в этом плагине идет сначало ник потом приставка (admin)

исходник
Код
#include <amxmisc>

#define VERSION "1.0.1"

#define ACCESS_LEVEL    ADMIN_CHAT // Доступ к цветному чату
#define MAX_SIMBOLS     128
#define MAX_SIZE     10

new g_OriginalSimb[MAX_SIMBOLS][MAX_SIZE], g_TranslitSimb[MAX_SIMBOLS][MAX_SIZE]
new g_Translit, g_Color, i_MaxSimbols

public plugin_init()
{
    register_plugin("Translit with Admin chat Colors", VERSION, "Makzz")
    
    g_Color = register_cvar ("amx_color", "2") // Цвет сообщения: [1] Жёлтый, [2] Зелёный, [3] Команда
    g_Translit = register_cvar ("amx_translit", "1")
    
    register_clcmd ("say","Hook_say" )
    register_clcmd ("say_team","Hook_say" )
    
    set_task(0.2, "LoadTranslitFile" )
}

public LoadTranslitFile()
{
    new s_File[64]
    get_configsdir (s_File, 63)
    format (s_File, 63, "%s/translit.ini", s_File)
    
    if ( file_exists ( s_File ) )
    {
        new Input[MAX_SIZE], Line, Len
        while( ( Line = read_file ( s_File, Line, Input, MAX_SIZE-1, Len ) ) != 0 )
        {
            if ( !Len || ( Input[0] == '/' ) )
                continue
            // Поверьте этот вариант разбивания строки в данном плагине лучше
            strtok(Input, g_OriginalSimb[i_MaxSimbols], MAX_SIZE/2, g_TranslitSimb[i_MaxSimbols], MAX_SIZE/2, ' ' )
            i_MaxSimbols++
        }
    }
    else
    {
        server_print ( "File not found %s", s_File )
        set_pcvar_num ( g_Translit, 0 )
    }
}

public Hook_say(id)
{
    if (is_user_hltv (id) || is_user_bot (id))
        return PLUGIN_CONTINUE
    
    new s_Msg[192], s_Out[192], bool:s_Transl, bool:s_Color
    read_args (s_Msg, 191)
    remove_quotes (s_Msg)
    
    if ( get_pcvar_num ( g_Translit ) )
    {
        new s_Info[2]
        get_user_info (id, "translit", s_Info, 1)
        if(equal(s_Info, "1"))
        {
            for (new i; i < i_MaxSimbols; i++)
            {
                if ( contain ( s_Msg, g_OriginalSimb[i] ) !=-1 )
                {
                    replace_all ( s_Msg, 191, g_OriginalSimb[i], g_TranslitSimb[i] )
                    s_Transl = true
                }
            }
        }
    }
    
    new p_Name[32]
    get_user_name(id,p_Name,31)
    
    if ( get_pcvar_num ( g_Color ) )
    {    
        if (get_user_flags(id) & ACCESS_LEVEL)
        {
            if ( !is_user_alive (id))
                format (s_Out, 191, "*DEAD* %s ", s_Out)
            
            new s_ColMode[3]
            switch(get_pcvar_num(g_Color))
            {
                case 1:
                    format(s_ColMode,2,"^1")
                case 2:
                    format(s_ColMode,2,"^4")
                case 3:
                    format(s_ColMode,3,"^3")
            }
            
            format (s_Out, 191, "^3%s ^1(^4ADMIN^1):%s %s", p_Name, s_ColMode, s_Msg)
            s_Color = true
        }
        else
            format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)
    }
    else
        format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)
    
    if ( s_Transl || s_Color )
    {
        server_print("%s : %s", p_Name,s_Msg)
        client_printcolor(0,s_Out)
        return PLUGIN_HANDLED
    }
    
    return PLUGIN_CONTINUE
}

stock client_printcolor(const id, const input[], any:...)
{
    new iCount = 1, iPlayers[32]
    
    static szMsg[191]
    vformat(szMsg, charsmax(szMsg), input, 3)
    
    // ^4 - зелёный
    // ^1 - жёлтый
    // ^3 - команда
    
    if(id) iPlayers[0] = id
    else get_players(iPlayers, iCount, "ch")
        
    for (new i; i < iCount; i++)
    {
        if (is_user_connected(iPlayers[i]))
        {
            emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
            ewrite_byte(iPlayers[i])
            ewrite_string(szMsg)
            emessage_end()
        }
    }
}

// Based on Translit by ZmifF
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя Bloo
сообщение 22.7.2014, 21:59
Сообщение #2


Стаж: 12 лет

Сообщений: 15547
Благодарностей: 6971
Полезность: 1206

nastia777, поставьте префикс менеджер от фримена, если только приставки нужны.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 22.7.2014, 22:01
Сообщение #3


Иконка группы

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

translit.ini

я понимаю, что тут храняться транслиты?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
nastia777
сообщение 22.7.2014, 22:03
Сообщение #4
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

Цитата(Bloo @ 22.7.2014, 21:59) *
nastia777, поставьте префикс менеджер от фримена, если только приставки нужны.


спасибо но он, не подойдет тут не только префиксы нужны

Цитата(GOOD FELLOW @ 22.7.2014, 22:01) *
translit.ini

я понимаю, что тут храняться транслиты?


да именно там !
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 22.7.2014, 22:07
Сообщение #5


Иконка группы

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

не уверен, но попробуй, компилит норм
Код:
#include <amxmisc>

#define VERSION "1.0.1"

#define ACCESS_LEVEL ADMIN_CHAT // Доступ к цветному чату
#define MAX_SIMBOLS 128
#define MAX_SIZE 10

new g_Color

public plugin_init()
{
register_plugin("Translit with Admin chat Colors", VERSION, "Makzz")

g_Color = register_cvar ("amx_color", "2") // Цвет сообщения: [1] Жёлтый, [2] Зелёный, [3] Команда

register_clcmd ("say","Hook_say" )
register_clcmd ("say_team","Hook_say" )

set_task(0.2, "LoadTranslitFile" )
}


public Hook_say(id)
{
if (is_user_hltv (id) || is_user_bot (id))
return PLUGIN_CONTINUE

new s_Msg[192], s_Out[192], bool:s_Transl, bool:s_Color
read_args (s_Msg, 191)
remove_quotes (s_Msg)

new p_Name[32]
get_user_name(id,p_Name,31)

if ( get_pcvar_num ( g_Color ) )
{
if (get_user_flags(id) & ACCESS_LEVEL)
{
if ( !is_user_alive (id))
format (s_Out, 191, "*DEAD* %s ", s_Out)

new s_ColMode[3]
switch(get_pcvar_num(g_Color))
{
case 1:
format(s_ColMode,2,"^1")
case 2:
format(s_ColMode,2,"^4")
case 3:
format(s_ColMode,3,"^3")
}

format (s_Out, 191, "^1(^4ADMIN^1) ^3%s: %s %s", p_Name, s_ColMode, s_Msg)
s_Color = true
}
else
format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)
}
else
format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)

if ( s_Transl || s_Color )
{
server_print("%s : %s", p_Name,s_Msg)
client_printcolor(0,s_Out)
return PLUGIN_HANDLED
}

return PLUGIN_CONTINUE
}

stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]

static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)

// ^4 - зелёный
// ^1 - жёлтый
// ^3 - команда

if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")

for (new i; i < iCount; i++)
{
if (is_user_connected(iPlayers[i]))
{
emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
ewrite_byte(iPlayers[i])
ewrite_string(szMsg)
emessage_end()
}
}
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
nastia777
сообщение 22.7.2014, 22:08
Сообщение #6
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

нужно что бы он работал совместно с Advanced Experience System
есть у кавото исходник Admin Chat Colors от Arion.?
чтобы не переделывать translit_with_chat_colors
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 22.7.2014, 22:10
Сообщение #7


Иконка группы

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

nastia777, переделанный под AES (для себя делал по гайду фримана и с его подсказками)

Код:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Admin Chat Colors"
#define VERSION "2.0"
#define AUTHOR "Arion"

#define ACCESS_LEVEL ADMIN_CHAT
#define ADMIN_LISTEN ADMIN_BAN

new message[192]
new sayText
new teamInfo
new maxPlayers

new g_MessageColor
new g_NameColor
new g_AdminListen

new strName[191]
new strText[191]
new alive[11]

public plugin_init()
{
register_plugin (PLUGIN, VERSION, AUTHOR)

g_MessageColor = register_cvar ("amx_color", "2") // Message colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red

g_NameColor = register_cvar ("amx_namecolor", "6") // Name colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-color

g_AdminListen = register_cvar ("amx_listen", "1") // Set whether admins see or not all messages (Alive, dead and team-only)


sayText = get_user_msgid ("SayText")
teamInfo = get_user_msgid ("TeamInfo")
maxPlayers = get_maxplayers()



register_clcmd ("amx_color", "set_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_namecolor", "set_name_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_listen", "set_listen", ACCESS_LEVEL, "<1 | 0>")

register_clcmd ("say", "hook_say")
register_clcmd ("say_team", "hook_teamsay")
}




public hook_say(id)
{
read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE


new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]



if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s%s", alive, name)

case 2:
format (strName, 191, "%s^x04%s", alive, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s^x03%s", alive, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s^x03%s", alive, name)
}

case 5:
{
color = "TERRORIST"
format (strName, 191, "%s^x03%s", alive, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}

case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)

format (strText, 191, "%s", message)
}

format (message, 191, "%s^x01 : %s", strName, strText)

sendMessage (color, isAlive) // Sends the colored message

return PLUGIN_HANDLED
}


public hook_teamsay(id)
{
new playerTeam = get_user_team(id)
new playerTeamName[19]

switch (playerTeam) // Team names which appear on team-only messages
{
case 1:
copy (playerTeamName, 11, "Terrorists")

case 2:
copy (playerTeamName, 18, "Counter-Terrorists")

default:
copy (playerTeamName, 9, "Spectator")
}

read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE


new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]



if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s(%s) %s", alive, playerTeamName, name)

case 2:
format (strName, 191, "%s(%s) ^x04%s", alive, playerTeamName, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 5:
{
color = "TERRORIST"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}

case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

format (strText, 191, "%s", message)
}

format (message, 191, "%s ^x01: %s", strName, strText)

sendTeamMessage (color, isAlive, playerTeam) // Sends the colored message

return PLUGIN_HANDLED
}


public set_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 5)
{
set_cvar_num ("amx_color", newColor)
set_pcvar_num (g_MessageColor, newColor)

if (get_pcvar_num (g_NameColor) != 1 &&
((newColor == 3 && get_pcvar_num (g_NameColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_NameColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_NameColor) != 5)))
{
set_cvar_num ("amx_namecolor", 2)
set_pcvar_num (g_NameColor, 2)
}
}

return PLUGIN_HANDLED
}


public set_name_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 6)
{
set_cvar_num ("amx_namecolor", newColor)
set_pcvar_num (g_NameColor, newColor)

if ((get_pcvar_num (g_MessageColor) != 1
&& ((newColor == 3 && get_pcvar_num (g_MessageColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_MessageColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_MessageColor) != 5)))
|| get_pcvar_num (g_NameColor) == 6)
{
set_cvar_num ("amx_color", 2)
set_pcvar_num (g_MessageColor, 2)
}
}

return PLUGIN_HANDLED
}


public set_listen (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newListen
read_argv(1, arg, 1)

newListen = str_to_num (arg)

set_cvar_num ("amx_listen", newListen)
set_pcvar_num (g_AdminListen, newListen)

return PLUGIN_HANDLED
}


public sendMessage (color[], alive)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue

if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}


public sendTeamMessage (color[], alive, playerTeam)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue

if (get_user_team(player) == playerTeam || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}
}


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, message[])
{
emessage_begin (MSG_ONE, sayText, {0, 0, 0}, player) // Tells to modify sayText (Which is responsable for writing colored messages)
ewrite_byte (player) // Write byte needed
ewrite_string (message) // Effectively write the message, finally, afterall
emessage_end () // Needed as always
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
nastia777
сообщение 22.7.2014, 22:11
Сообщение #8
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

Цитата(GOOD FELLOW @ 22.7.2014, 22:07) *
не уверен, но попробуй, компилит норм
Код:
#include <amxmisc>

#define VERSION "1.0.1"

#define ACCESS_LEVEL ADMIN_CHAT // Доступ к цветному чату
#define MAX_SIMBOLS 128
#define MAX_SIZE 10

new g_Color

public plugin_init()
{
register_plugin("Translit with Admin chat Colors", VERSION, "Makzz")

g_Color = register_cvar ("amx_color", "2") // Цвет сообщения: [1] Жёлтый, [2] Зелёный, [3] Команда

register_clcmd ("say","Hook_say" )
register_clcmd ("say_team","Hook_say" )

set_task(0.2, "LoadTranslitFile" )
}


public Hook_say(id)
{
if (is_user_hltv (id) || is_user_bot (id))
return PLUGIN_CONTINUE

new s_Msg[192], s_Out[192], bool:s_Transl, bool:s_Color
read_args (s_Msg, 191)
remove_quotes (s_Msg)

new p_Name[32]
get_user_name(id,p_Name,31)

if ( get_pcvar_num ( g_Color ) )
{
if (get_user_flags(id) & ACCESS_LEVEL)
{
if ( !is_user_alive (id))
format (s_Out, 191, "*DEAD* %s ", s_Out)

new s_ColMode[3]
switch(get_pcvar_num(g_Color))
{
case 1:
format(s_ColMode,2,"^1")
case 2:
format(s_ColMode,2,"^4")
case 3:
format(s_ColMode,3,"^3")
}

format (s_Out, 191, "^1(^4ADMIN^1) ^3%s: %s %s", p_Name, s_ColMode, s_Msg)
s_Color = true
}
else
format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)
}
else
format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)

if ( s_Transl || s_Color )
{
server_print("%s : %s", p_Name,s_Msg)
client_printcolor(0,s_Out)
return PLUGIN_HANDLED
}

return PLUGIN_CONTINUE
}

stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]

static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)

// ^4 - зелёный
// ^1 - жёлтый
// ^3 - команда

if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")

for (new i; i < iCount; i++)
{
if (is_user_connected(iPlayers[i]))
{
emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
ewrite_byte(iPlayers[i])
ewrite_string(szMsg)
emessage_end()
}
}
}


спасибо сейчас проверю
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
nastia777
сообщение 22.7.2014, 22:19
Сообщение #9
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

Цитата(GOOD FELLOW @ 22.7.2014, 22:10) *
nastia777, переделанный под AES (для себя делал по гайду фримана и с его подсказками)

Код:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Admin Chat Colors"
#define VERSION "2.0"
#define AUTHOR "Arion"

#define ACCESS_LEVEL ADMIN_CHAT
#define ADMIN_LISTEN ADMIN_BAN

new message[192]
new sayText
new teamInfo
new maxPlayers

new g_MessageColor
new g_NameColor
new g_AdminListen

new strName[191]
new strText[191]
new alive[11]

public plugin_init()
{
register_plugin (PLUGIN, VERSION, AUTHOR)

g_MessageColor = register_cvar ("amx_color", "2") // Message colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red

g_NameColor = register_cvar ("amx_namecolor", "6") // Name colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-color

g_AdminListen = register_cvar ("amx_listen", "1") // Set whether admins see or not all messages (Alive, dead and team-only)


sayText = get_user_msgid ("SayText")
teamInfo = get_user_msgid ("TeamInfo")
maxPlayers = get_maxplayers()



register_clcmd ("amx_color", "set_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_namecolor", "set_name_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_listen", "set_listen", ACCESS_LEVEL, "<1 | 0>")

register_clcmd ("say", "hook_say")
register_clcmd ("say_team", "hook_teamsay")
}




public hook_say(id)
{
read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE


new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]



if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s%s", alive, name)

case 2:
format (strName, 191, "%s^x04%s", alive, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s^x03%s", alive, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s^x03%s", alive, name)
}

case 5:
{
color = "TERRORIST"
format (strName, 191, "%s^x03%s", alive, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}

case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)

format (strText, 191, "%s", message)
}

format (message, 191, "%s^x01 : %s", strName, strText)

sendMessage (color, isAlive) // Sends the colored message

return PLUGIN_HANDLED
}


public hook_teamsay(id)
{
new playerTeam = get_user_team(id)
new playerTeamName[19]

switch (playerTeam) // Team names which appear on team-only messages
{
case 1:
copy (playerTeamName, 11, "Terrorists")

case 2:
copy (playerTeamName, 18, "Counter-Terrorists")

default:
copy (playerTeamName, 9, "Spectator")
}

read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE


new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]



if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s(%s) %s", alive, playerTeamName, name)

case 2:
format (strName, 191, "%s(%s) ^x04%s", alive, playerTeamName, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 5:
{
color = "TERRORIST"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}

case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

format (strText, 191, "%s", message)
}

format (message, 191, "%s ^x01: %s", strName, strText)

sendTeamMessage (color, isAlive, playerTeam) // Sends the colored message

return PLUGIN_HANDLED
}


public set_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 5)
{
set_cvar_num ("amx_color", newColor)
set_pcvar_num (g_MessageColor, newColor)

if (get_pcvar_num (g_NameColor) != 1 &&
((newColor == 3 && get_pcvar_num (g_NameColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_NameColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_NameColor) != 5)))
{
set_cvar_num ("amx_namecolor", 2)
set_pcvar_num (g_NameColor, 2)
}
}

return PLUGIN_HANDLED
}


public set_name_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 6)
{
set_cvar_num ("amx_namecolor", newColor)
set_pcvar_num (g_NameColor, newColor)

if ((get_pcvar_num (g_MessageColor) != 1
&& ((newColor == 3 && get_pcvar_num (g_MessageColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_MessageColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_MessageColor) != 5)))
|| get_pcvar_num (g_NameColor) == 6)
{
set_cvar_num ("amx_color", 2)
set_pcvar_num (g_MessageColor, 2)
}
}

return PLUGIN_HANDLED
}


public set_listen (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newListen
read_argv(1, arg, 1)

newListen = str_to_num (arg)

set_cvar_num ("amx_listen", newListen)
set_pcvar_num (g_AdminListen, newListen)

return PLUGIN_HANDLED
}


public sendMessage (color[], alive)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue

if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}


public sendTeamMessage (color[], alive, playerTeam)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue

if (get_user_team(player) == playerTeam || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}
}


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, message[])
{
emessage_begin (MSG_ONE, sayText, {0, 0, 0}, player) // Tells to modify sayText (Which is responsable for writing colored messages)
ewrite_byte (player) // Write byte needed
ewrite_string (message) // Effectively write the message, finally, afterall
emessage_end () // Needed as always
}

Спасибо тебе огромное
могу отблогодарить $
ну или кинь свой ип в лс, кини твой сервер на раскрутку к себе
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
nastia777
сообщение 22.7.2014, 23:17
Сообщение #10
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

есть одна проблема
у меня завние например лейтенант

когда пишет рядовой ну или (любой другой игрок с другим званием)
я все вижу всех в чате как лейтенант (мое звание)

как исправить ?
на скрине видно что у всех мл.сержант (мое звание)
хотя у одного звание рядовой у второго ст.сержант

Отредактировал: nastia777, - 22.7.2014, 23:24
Прикрепленные файлы:
Прикрепленное изображение
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 22.7.2014, 23:22
Сообщение #11


Иконка группы

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

amx_listen 0 в amxx.cfg
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
nastia777
сообщение 22.7.2014, 23:30
Сообщение #12
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

не помогло sad.gif
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
nastia777
сообщение 22.7.2014, 23:51
Сообщение #13
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

ставлю этот плагин все нормально работает только приставка админ, звание нету (Admin) ник
у простых игроков все нормально все звание работают [Рядовой] ник
можно как то исправить ?
что бы было вот так [Admin] [Рядовой] ник ?
и не работает /anew sad.gif
Код:
#include <amxmisc>

#define VERSION "1.0.1"

#define ACCESS_LEVEL ADMIN_CHAT // Доступ к цветному чату
#define MAX_SIMBOLS 128
#define MAX_SIZE 10

new g_Color

public plugin_init()
{
register_plugin("Translit with Admin chat Colors", VERSION, "Makzz")

g_Color = register_cvar ("amx_color", "2") // Цвет сообщения: [1] Жёлтый, [2] Зелёный, [3] Команда

register_clcmd ("say","Hook_say" )
register_clcmd ("say_team","Hook_say" )

set_task(0.2, "LoadTranslitFile" )
}


public Hook_say(id)
{
if (is_user_hltv (id) || is_user_bot (id))
return PLUGIN_CONTINUE

new s_Msg[192], s_Out[192], bool:s_Transl, bool:s_Color
read_args (s_Msg, 191)
remove_quotes (s_Msg)

new p_Name[32]
get_user_name(id,p_Name,31)

if ( get_pcvar_num ( g_Color ) )
{
if (get_user_flags(id) & ACCESS_LEVEL)
{
if ( !is_user_alive (id))
format (s_Out, 191, "*DEAD* %s ", s_Out)

new s_ColMode[3]
switch(get_pcvar_num(g_Color))
{
case 1:
format(s_ColMode,2,"^1")
case 2:
format(s_ColMode,2,"^4")
case 3:
format(s_ColMode,3,"^3")
}

format (s_Out, 191, "^1(^4ADMIN^1) ^3%s: %s %s", p_Name, s_ColMode, s_Msg)
s_Color = true
}
else
format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)
}
else
format(s_Out, 191, "^3%s ^1: %s", p_Name, s_Msg)

if ( s_Transl || s_Color )
{
server_print("%s : %s", p_Name,s_Msg)
client_printcolor(0,s_Out)
return PLUGIN_HANDLED
}

return PLUGIN_CONTINUE
}

stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]

static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)

// ^4 - зелёный
// ^1 - жёлтый
// ^3 - команда

if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")

for (new i; i < iCount; i++)
{
if (is_user_connected(iPlayers[i]))
{
emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
ewrite_byte(iPlayers[i])
ewrite_string(szMsg)
emessage_end()
}
}
}


Отредактировал: nastia777, - 23.7.2014, 0:18
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
nastia777
сообщение 23.7.2014, 15:32
Сообщение #14
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

может кто знает как поправить ?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
serfreeman1337
сообщение 23.7.2014, 15:38
Сообщение #15
Стаж: 13 лет

Сообщений: 912
Благодарности: выкл.

Код:
ewrite_byte(iPlayers[i])
Замени на:
Код:
ewrite_byte(id)
И
Код:
client_printcolor(0,s_Out)
На:
Код:
client_printcolor(id,s_Out)

Хотя фз, этот транслит написан в стиле "oppa govno kod".
Цитата(nastia777)
что бы было вот так [Admin] [Рядовой] ник ?

Если только префикс менеджером.
Цитата(nastia777)
и не работает /anew

Ставь ниже всех плагинов. Заметь что /anew по дефолту прописан в файле plugins-aes.ini
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
nastia777
сообщение 23.7.2014, 16:05
Сообщение #16
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

Цитата(nastia777 @ 22.7.2014, 22:19) *
Спасибо тебе огромное
могу отблогодарить $
ну или кинь свой ип в лс, кини твой сервер на раскрутку к себе

вот этот код можно по править ?
Код:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Admin Chat Colors"
#define VERSION "2.0"
#define AUTHOR "Arion"

#define ACCESS_LEVEL ADMIN_CHAT
#define ADMIN_LISTEN ADMIN_BAN

new message[192]
new sayText
new teamInfo
new maxPlayers

new g_MessageColor
new g_NameColor
new g_AdminListen

new strName[191]
new strText[191]
new alive[11]

public plugin_init()
{
register_plugin (PLUGIN, VERSION, AUTHOR)

g_MessageColor = register_cvar ("amx_color", "2") // Message colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red

g_NameColor = register_cvar ("amx_namecolor", "6") // Name colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-color

g_AdminListen = register_cvar ("amx_listen", "1") // Set whether admins see or not all messages (Alive, dead and team-only)


sayText = get_user_msgid ("SayText")
teamInfo = get_user_msgid ("TeamInfo")
maxPlayers = get_maxplayers()



register_clcmd ("amx_color", "set_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_namecolor", "set_name_color", ACCESS_LEVEL, "<color>")
register_clcmd ("amx_listen", "set_listen", ACCESS_LEVEL, "<1 | 0>")

register_clcmd ("say", "hook_say")
register_clcmd ("say_team", "hook_teamsay")
}




public hook_say(id)
{
read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE


new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]



if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s%s", alive, name)

case 2:
format (strName, 191, "%s^x04%s", alive, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s^x03%s", alive, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s^x03%s", alive, name)
}

case 5:
{
color = "TERRORIST"
format (strName, 191, "%s^x03%s", alive, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}

case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s^x03%s", alive, name)

format (strText, 191, "%s", message)
}

format (message, 191, "%s^x01 : %s", strName, strText)

sendMessage (color, isAlive) // Sends the colored message

return PLUGIN_HANDLED
}


public hook_teamsay(id)
{
new playerTeam = get_user_team(id)
new playerTeamName[19]

switch (playerTeam) // Team names which appear on team-only messages
{
case 1:
copy (playerTeamName, 11, "Terrorists")

case 2:
copy (playerTeamName, 18, "Counter-Terrorists")

default:
copy (playerTeamName, 9, "Spectator")
}

read_args (message, 191)
remove_quotes (message)

if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
// Gungame commands and empty messages
return PLUGIN_CONTINUE


new name[32]
get_user_name (id, name, 31)

new bool:admin = false

if (get_user_flags(id) & ACCESS_LEVEL)
admin = true


new isAlive

if (is_user_alive (id))
{
isAlive = 1
alive = "^x01"
}
else
{
isAlive = 0
alive = "^x01*DEAD* "
}

static color[10]



if (admin)
{
// Name
switch (get_pcvar_num (g_NameColor))
{
case 1:
format (strName, 191, "%s(%s) %s", alive, playerTeamName, name)

case 2:
format (strName, 191, "%s(%s) ^x04%s", alive, playerTeamName, name)

case 3:
{
color = "SPECTATOR"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 4:
{
color = "CT"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 5:
{
color = "TERRORIST"
format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}

case 6:
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
}
}


// Message
switch (get_pcvar_num (g_MessageColor))
{
case 1: // Yellow
format (strText, 191, "%s", message)

case 2: // Green
format (strText, 191, "^x04%s", message)

case 3: // White
{
copy (color, 9, "SPECTATOR")
format (strText, 191, "^x03%s", message)
}

case 4: // Blue
{
copy (color, 9, "CT")
format (strText, 191, "^x03%s", message)
}

case 5: // Red
{
copy (color, 9, "TERRORIST")
format (strText, 191, "^x03%s", message)
}
}
}

else // Player is not admin. Team-color name : Yellow message
{
get_user_team (id, color, 9)

format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

format (strText, 191, "%s", message)
}

format (message, 191, "%s ^x01: %s", strName, strText)

sendTeamMessage (color, isAlive, playerTeam) // Sends the colored message

return PLUGIN_HANDLED
}


public set_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 5)
{
set_cvar_num ("amx_color", newColor)
set_pcvar_num (g_MessageColor, newColor)

if (get_pcvar_num (g_NameColor) != 1 &&
((newColor == 3 && get_pcvar_num (g_NameColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_NameColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_NameColor) != 5)))
{
set_cvar_num ("amx_namecolor", 2)
set_pcvar_num (g_NameColor, 2)
}
}

return PLUGIN_HANDLED
}


public set_name_color (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newColor
read_argv (1, arg, 1)

newColor = str_to_num (arg)

if (newColor >= 1 && newColor <= 6)
{
set_cvar_num ("amx_namecolor", newColor)
set_pcvar_num (g_NameColor, newColor)

if ((get_pcvar_num (g_MessageColor) != 1
&& ((newColor == 3 && get_pcvar_num (g_MessageColor) != 3)
|| (newColor == 4 && get_pcvar_num (g_MessageColor) != 4)
|| (newColor == 5 && get_pcvar_num (g_MessageColor) != 5)))
|| get_pcvar_num (g_NameColor) == 6)
{
set_cvar_num ("amx_color", 2)
set_pcvar_num (g_MessageColor, 2)
}
}

return PLUGIN_HANDLED
}


public set_listen (id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new arg[1], newListen
read_argv(1, arg, 1)

newListen = str_to_num (arg)

set_cvar_num ("amx_listen", newListen)
set_pcvar_num (g_AdminListen, newListen)

return PLUGIN_HANDLED
}


public sendMessage (color[], alive)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue

if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}


public sendTeamMessage (color[], alive, playerTeam)
{
new teamName[10]

for (new player = 1; player < maxPlayers; player++)
{
if (!is_user_connected(player))
continue

if (get_user_team(player) == playerTeam || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
{
get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message

changeTeamInfo (player, color) // Changes user's team according to color choosen

writeMessage (player, message) // Writes the message on player's chat

changeTeamInfo (player, teamName) // Changes user's team back to original
}
}
}
}


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, message[])
{
emessage_begin (MSG_ONE, sayText, {0, 0, 0}, player) // Tells to modify sayText (Which is responsable for writing colored messages)
ewrite_byte (player) // Write byte needed
ewrite_string (message) // Effectively write the message, finally, afterall
emessage_end () // Needed as always
}


есть одна проблема
у меня завние например лейтенант

когда пишет рядовой ну или (любой другой игрок с другим званием)
я все вижу всех в чате как лейтенант (мое звание)

как исправить ?
на скрине видно что у всех мл.сержант (мое звание)
хотя у одного звание рядовой у второго ст.сержант

Отредактировал: nastia777, - 23.7.2014, 16:08
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
nastia777
сообщение 23.7.2014, 16:56
Сообщение #17
Стаж: 13 лет

Сообщений: 606
Благодарностей: 485
Полезность: 510

Цитата(serfreeman1337 @ 23.7.2014, 15:38) *
Код:
ewrite_byte(iPlayers[i])
Замени на:
Код:
ewrite_byte(id)
И
Код:
client_printcolor(0,s_Out)
На:
Код:
client_printcolor(id,s_Out)

Хотя фз, этот транслит написан в стиле "oppa govno kod".

Если только префикс менеджером.

Ставь ниже всех плагинов. Заметь что /anew по дефолту прописан в файле plugins-aes.ini


не работает !

Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: