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

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

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

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

Lite Translit сообщения красным цветом

Статус пользователя Captain
сообщение 16.9.2017, 15:19
Сообщение #1
Стаж: 12 лет

Сообщений: 251
Благодарностей: 7
Полезность: < 0

Всем привет. Возможно ли сделать, чтобы админы писали в чате не зеленым, а красным цветом постоянно?

Cкрытый текст
Код:
// ********************************************************************************
*****//
// Плагин загружен с www.neugomon.ru //
// Автор: Neygomon [ https://neugomon.ru/members/1/ ] //
// Официальная тема поддержки: https://neugomon.ru/threads/110/ //
// При копировании материала ссылка на сайт www.neugomon.ru ОБЯЗАТЕЛЬНА! //
// ********************************************************************************
*****//
#include <amxmodx>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

/*
Спасибо PRoSToTeM@ за новый способ транслитерации
*/

#define TAGS // Теги в чате Гл. Админ | Админ | VIP [ По умолчанию выключен ]
#if defined TAGS
#define LT_PREFIXES // Свои префиксы. Файл addons/amxmodx/configs/lt_prefixes.ini [ По умолчанию включен ]
#endif
// #define STEAM // Тег стим игрока [ По умолчанию выключен ]
#define GREEN_MSG // Зеленый цвет чата админов и випов [ По умолчанию выключен ]
// #define AES // Поддержка системы армейских званий - AES ( <a href="https://c-s.net.ua/forum/topic56564.html" target="_blank"></a> ) [ По умолчанию выключен ]
// #define DEF_RUS // Русский язык по умолчанию [ По умолчанию английский ]
#define GL_ADMIN ADMIN_RCON // Флаг доступа для тега "Гл. Админ" в чате
#define ADMIN ADMIN_BAN // Флаг доступа для тега "Админ" в чате
#define VIP ADMIN_LEVEL_H // Флаг доступа для тега "VIP" в чате
#define ANTIFLOOD // Замена стандартного плагина antiflood.amxx [ По умолчанию выключен ]
#define AD_TIME 0.75 // Время между сообщениями, когда сработает антифлуд система
#define ADMIN_ALLCHAT // Показывать весь чат админам [ По умолчанию включен ]
//#define DEFAULT_CS_CHAT // Cтандартный чат кс [ По умолчанию выключен ]
//Живые общаются только с живыми, мертвые с мертвыми. Админ видит весь чат если ADMIN_ALLCHAT
#if defined AES
enum _:
{
AES_ST_EXP,
AES_ST_LEVEL,
AES_ST_BONUSES,
AES_ST_NEXTEXP,
AES_ST_END
};
native aes_get_player_stats(id, data[4]);
native aes_get_level_name(lvlnum, level[], len, idLang = 0);

public plugin_natives()
set_native_filter("native_filter");

public native_filter(const name[], index, trap)
return !trap ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
#endif

new const g_chConvert[94 * 2 char] =
{
0x2100D0AD, 0x2300D0B6, 0x25003F00, 0xD18D2800, 0x29002A00, 0x2B00D0B1, 0x2D00D18E, 0x2E003000,
0x31003200, 0x33003400, 0x35003600, 0x37003800, 0x3900D096, 0xD0B6D091, 0x3D00D0AE, 0x2C002200,
0xD0A4D098, 0xD0A1D092, 0xD0A3D090, 0xD09FD0A0, 0xD0A8D09E, 0xD09BD094, 0xD0ACD0A2, 0xD0A9D097,
0xD099D09A, 0xD0ABD095, 0xD093D09C, 0xD0A6D0A7, 0xD09DD0AF, 0xD1855C00, 0xD18A3A00, 0x5F00D191,
0xD184D0B8, 0xD181D0B2, 0xD183D0B0, 0xD0BFD180, 0xD188D0BE, 0xD0BBD0B4, 0xD18CD182, 0xD189D0B7,
0xD0B9D0BA, 0xD18BD0B5, 0xD0B3D0BC, 0xD186D187, 0xD0BDD18F, 0xD0A52F00, 0xD0AAD081
};

new bool:g_bUseRus[33];
#if defined STEAM
new bool:g_bIsSteam[33];
#endif
#if defined LT_PREFIXES
enum _:DATA
{
TYPE[2],
AUTH[32],
PREFIX[64]
};
new Array:g_aData, g_PlayerData[DATA];
new g_szPrefix[33][64];
#endif

#define GetBit(%1,%2) (%1 & (1 << (%2 & 31)))
#define SetBit(%1,%2) %1 |= (1 << (%2 & 31))
#define ResetBit(%1,%2) %1 &= ~(1 << (%2 & 31))
#if defined ADMIN_ALLCHAT
new g_bitAdmin;
#endif
new g_bitAlive;

public plugin_init()
{
#define VERSION "2.8"
register_plugin("Lite Translit", VERSION, "neygomon");
register_cvar("lt_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);

register_clcmd("say /rus", "LangCtrlRus");
register_clcmd("say /eng", "LangCtrlEng");

register_clcmd("say", "HandlerSay");
register_clcmd("say_team", "HandlerSayTeam");

register_event("ResetHUD", "eResetHUD", "be");
register_event("DeathMsg", "eDeathMsg", "a", "1>0");
}

#if defined LT_PREFIXES
public plugin_cfg()
{
g_aData = ArrayCreate(DATA);

new buff[256], fp = fopen("addons/amxmodx/configs/lt_prefixes.ini", "rt");
if(!fp) return set_fail_state("File ^"addons/amxmodx/configs/lt_prefixes.ini^" not found");

while(!feof(fp))
{
fgets(fp, buff, charsmax(buff));
if(buff[0] && buff[0] != ';' && parse(buff, g_PlayerData[TYPE], charsmax(g_PlayerData[TYPE]), g_PlayerData[AUTH], charsmax(g_PlayerData[AUTH]), g_PlayerData[PREFIX], charsmax(g_PlayerData[PREFIX])))
ArrayPushArray(g_aData, g_PlayerData);
}
return fclose(fp);
}
#endif
public client_putinserver(id)
{
#if defined LT_PREFIXES
SearchClient(id);
#endif
#if defined DEF_RUS
g_bUseRus[id] = true;
#else
g_bUseRus[id] = false;
#endif
#if defined STEAM
g_bIsSteam[id] = is_user_steam(id) ? true : false;
#endif
#if defined ADMIN_ALLCHAT
if(get_user_flags(id) & ADMIN_CHAT) SetBit(g_bitAdmin, id);
else ResetBit(g_bitAdmin, id);
#endif
}

public client_disconnected(id) ResetBit(g_bitAlive, id);
public eResetHUD(id) SetBit(g_bitAlive, id);
public eDeathMsg() ResetBit(g_bitAlive, read_data(2));

public HandlerSay(id) return FormatMsg(id, false);
public HandlerSayTeam(id) return FormatMsg(id, true);

public LangCtrlRus(id)
{
if(g_bUseRus[id])
client_print(id, print_chat, "*** [LT] Русский язык УЖЕ включен! ***");
else
{
client_print(id, print_chat, "*** [LT] Русский язык активирован! ***");
g_bUseRus[id] = true;
client_cmd(id, "spk buttons/blip1.wav");
}
}

public LangCtrlEng(id)
{
if(!g_bUseRus[id])
client_print(id, print_chat, "*** [LT] Английский язык УЖЕ включен! ***");
else
{
client_print(id, print_chat, "*** [LT] Английский язык активирован! ***");
g_bUseRus[id] = false;
client_cmd(id, "spk buttons/blip1.wav");
}
}

FormatMsg(id, bool:IsTeam)
{
#define MAX_BYTES 180
static sMessage[MAX_BYTES], sConvertStr[charsmax(sMessage) * 2 + 1];
read_args(sMessage, charsmax(sMessage));
remove_quotes(sMessage); trim(sMessage);

if(sMessage[0] == EOS || sMessage[0] == '/')
return PLUGIN_HANDLED_MAIN;
#if defined ANTIFLOOD
static Float:fTimeFlood[33], Float:fGameTime, iFloodWarn[33];

if(fTimeFlood[id] > (fGameTime = get_gametime()))
{
if(++iFloodWarn[id] > 2)
{
client_print(id, print_chat, "*** [LT] Прекратите флудить! ***");
fTimeFlood[id] = fGameTime + AD_TIME + 3.0;
return PLUGIN_HANDLED;
}
}
else if(iFloodWarn[id]) iFloodWarn[id]--;
fTimeFlood[id] = fGameTime + AD_TIME;
#endif
static iLen, sTags[MAX_BYTES], idTeam, sTeam[16];
idTeam = get_user_team(id, sTeam, charsmax(sTeam));

switch(idTeam)
{
case 1: iLen = formatex(sTags, charsmax(sTags), "%s%s", GetBit(g_bitAlive, id) ? "^1" : "^1*^3Мертвый^1* ", IsTeam ? "^1[^3TT^1]" : "");
case 2: iLen = formatex(sTags, charsmax(sTags), "%s%s", GetBit(g_bitAlive, id) ? "^1" : "^1*^3Мертвый^1* ", IsTeam ? "^1[^3CT^1]" : "");
default:iLen = formatex(sTags, charsmax(sTags), "^1*^3Spec^1* ");
}
#if defined GREEN_MSG || (defined TAGS && !defined LT_PREFIXES)
static IsAccess; IsAccess = CheckFlags(id);
#endif
#if defined AES
static AESLvl[33][64], aStats[AES_ST_END];
aes_get_player_stats(id, aStats); aes_get_level_name(aStats[AES_ST_LEVEL], AESLvl[id], charsmax(AESLvl[]), LANG_SERVER);
iLen += formatex(sTags[iLen], charsmax(sTags) - iLen, "^4[%s] ", AESLvl[id]);
#endif
#if defined STEAM
if(g_bIsSteam[id])
iLen += formatex(sTags[iLen], charsmax(sTags) - iLen, "^1[^4Steam^1] ");
#endif
#if defined TAGS
#if defined LT_PREFIXES
if(g_szPrefix[id][0])
{
replace_all(g_szPrefix[id], charsmax(g_szPrefix[]), "!n", "^1");
replace_all(g_szPrefix[id], charsmax(g_szPrefix[]), "!t", "^3");
replace_all(g_szPrefix[id], charsmax(g_szPrefix[]), "!g", "^4");
iLen += formatex(sTags[iLen], charsmax(sTags) - iLen, "%s ", g_szPrefix[id]);
}
#else
static const szAdminPrefix[][] = { "", "^1[^4Гл. Админ^1] ", "^1[^4Админ^1] ", "^1[^4VIP^1] " };
iLen += formatex(sTags[iLen], charsmax(sTags) - iLen, "%s", szAdminPrefix[IsAccess]);
#endif
#endif
static sName[32];
get_user_name(id, sName, charsmax(sName));
#if defined GREEN_MSG
iLen += formatex(sTags[iLen], charsmax(sTags) - iLen, "^3%s^1 : %s", sName, IsAccess ? "^4" : "");
#else
iLen += formatex(sTags[iLen], charsmax(sTags) - iLen, "^3%s^1 : ", sName);
#endif
if(g_bUseRus[id])
{
new nLen;
for(new n; sMessage[n] != EOS; n++)
{
if('!' <= sMessage[n] <= '~')
{
sConvertStr[nLen++] = g_chConvert{(sMessage[n] - '!') * 2};
if(g_chConvert{(sMessage[n] - '!') * 2 + 1} != EOS)
sConvertStr[nLen++] = g_chConvert{(sMessage[n] - '!') * 2 + 1};
}
else sConvertStr[nLen++] = sMessage[n];
}
sConvertStr[nLen] = EOS;
}
else sConvertStr = sMessage;

static iByteLimit; iByteLimit = MAX_BYTES;
while(iLen + strlen(sConvertStr) > MAX_BYTES)
sConvertStr[iByteLimit -= 10] = 0;

iLen += formatex(sTags[iLen], charsmax(sTags) - iLen, sConvertStr);

static players[32], pcount; get_players(players, pcount, "c");
switch(IsTeam)
{
case true:
{
for(new i; i < pcount; i++)
{
#if defined ADMIN_ALLCHAT
if(GetBit(g_bitAdmin, players[i]) || (GetBit(g_bitAlive, id) == GetBit(g_bitAlive, players[i]) && idTeam == get_user_team(players[i])))
#else
if(GetBit(g_bitAlive, id) == GetBit(g_bitAlive, players[i]) && idTeam == get_user_team(players[i]))
#endif
SendMsgChat(players[i], idTeam, sTags);
}
}
case false:
{
for(new i; i < pcount; i++)
#if defined DEFAULT_CS_CHAT
#if defined ADMIN_ALLCHAT
if(GetBit(g_bitAdmin, players[i]) || GetBit(g_bitAlive, id) == GetBit(g_bitAlive, players[i]))
#else
if(GetBit(g_bitAlive, id) == GetBit(g_bitAlive, players[i]))
#endif
SendMsgChat(players[i], idTeam, sTags);
#else
SendMsgChat(players[i], idTeam, sTags);
#endif
}
}
static sAuthId[25]; get_user_authid(id, sAuthId, charsmax(sAuthId));
log_message("^"%s<%d><%s><%s>^" %s ^"%s^"", sName, get_user_userid(id), sAuthId, sTeam, IsTeam ? "say_team" : "say" , sConvertStr);
return PLUGIN_HANDLED;
}

stock SendMsgChat(player, team, msg[])
{
switch(team)
{
case 1: client_print_color(player, print_team_red, msg);
case 2: client_print_color(player, print_team_blue, msg);
default:client_print_color(player, print_team_grey, msg);
}
}

stock SearchClient(const id)
{
for(new i; i < ArraySize(g_aData); i++)
{
ArrayGetArray(g_aData, i, g_PlayerData);
switch(g_PlayerData[TYPE])
{
case 'f':
{
if(get_user_flags(id) & read_flags(g_PlayerData[AUTH]))
return copy(g_szPrefix[id], charsmax(g_szPrefix[]), g_PlayerData[PREFIX]);
}
case 'i':
{
static sIP[16]; get_user_ip(id, sIP, charsmax(sIP), 1);
if(!strcmp(g_PlayerData[AUTH], sIP))
return copy(g_szPrefix[id], charsmax(g_szPrefix[]), g_PlayerData[PREFIX]);
}
case 's':
{
static sAuthid[25]; get_user_authid(id, sAuthid, charsmax(sAuthid));
if(!strcmp(g_PlayerData[AUTH], sAuthid))
return copy(g_szPrefix[id], charsmax(g_szPrefix[]), g_PlayerData[PREFIX]);
}
}
}
return g_szPrefix[id][0] = 0;
}

stock CheckFlags(id)
{
static iFlags; iFlags = get_user_flags(id);
if(iFlags & GL_ADMIN) return 1;
else if(iFlags & ADMIN) return 2;
else if(iFlags & VIP) return 3;
return 0;
}

stock bool:is_user_steam(id)
{
static dp_pointer;
if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", id);
server_exec();
return (get_pcvar_num(dp_pointer) == 2) ? true : false;
}
return false;
}


Отредактировал: Captain, - 16.9.2017, 15:21
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя energydance
сообщение 16.9.2017, 15:28
Сообщение #2


Стаж: 10 лет

Сообщений: 2809
Благодарностей: 740
Полезность: 213

Captain, нет rolleyes.gif


Press enter to exit ...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Captain
сообщение 16.9.2017, 15:32
Сообщение #3
Стаж: 12 лет

Сообщений: 251
Благодарностей: 7
Полезность: < 0

Цитата(energydance @ 16.9.2017, 16:28) *
Captain, нет rolleyes.gif

вообще никак?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя energydance
сообщение 16.9.2017, 15:39
Сообщение #4


Стаж: 10 лет

Сообщений: 2809
Благодарностей: 740
Полезность: 213

Captain, ну в данном коде вроде бы как нет , есть на свете плагин не помню названия вроде бы colorchat , там можно писать красным , синим , зеленым и белым не зависимо от команды
видел как то пару лет назад на каком-то сервере


Press enter to exit ...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vasiok007
сообщение 16.9.2017, 15:49
Сообщение #5


Стаж: 15 лет
Город: Кишинев

Сообщений: 157
Благодарностей: 56
Полезность: 258

Можно изменить цвет чата у клиента на любой цвет, подробнее:
Color Chat Menu
https://c-s.net.ua/forum/topic86618.html?view=findpost&p=1016728


Мир всем местным
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя energydance
сообщение 16.9.2017, 16:04
Сообщение #6


Стаж: 10 лет

Сообщений: 2809
Благодарностей: 740
Полезность: 213

Vasiok007, из за сообщения тс явно видно что ему нужно чтобы админы могли писать красным цветом и чтоб это видели все игроки


Press enter to exit ...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Captain
сообщение 16.9.2017, 16:12
Сообщение #7
Стаж: 12 лет

Сообщений: 251
Благодарностей: 7
Полезность: < 0

Нашёл плагин. Там есть решение моего вопроса. Но только не понимаю как добиться этого на моем исходнике.

Cкрытый текст
Код:
#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_message (sayText, "avoid_duplicated")

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 avoid_duplicated (msgId, msgDest, receiver)
{
return PLUGIN_HANDLED
}


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_CONTINUE
}


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_CONTINUE
}


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[])
{
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 (message) // Effectively write the message, finally, afterall
message_end () // Needed as always
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя energydance
сообщение 16.9.2017, 18:22
Сообщение #8


Стаж: 10 лет

Сообщений: 2809
Благодарностей: 740
Полезность: 213

Captain, Ване напиши , может сделает


Press enter to exit ...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Captain
сообщение 16.9.2017, 19:04
Сообщение #9
Стаж: 12 лет

Сообщений: 251
Благодарностей: 7
Полезность: < 0

Цитата(energydance @ 16.9.2017, 19:22) *
Captain, Ване напиши , может сделает

а кто это?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя energydance
сообщение 16.9.2017, 19:20
Сообщение #10


Стаж: 10 лет

Сообщений: 2809
Благодарностей: 740
Полезность: 213

Captain, автор плагина Lite Translit


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