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

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

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

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

4 страниц V   1 2 3 »

Voices Management

, Разделение голосового чата
Статус пользователя adva
сообщение 20.2.2014, 21:52
Сообщение #1


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

Стаж: 12 лет

Сообщений: 2543
Благодарностей: 1676
Полезность: 819

Меценат Меценат

Всем привет!
Вся задумка была разделить голосовой чат так, чтобы:

живые СТ слышали только живых СТ
живые Т слышали только живых Т
мертвые СТ слышали живых и мертвых СТ, Т
мертвые Т слышали живых и мертвых Т, СТ

Нашёл этот плагин в итоге, называется Voices Management
вот ссылка
Скрытый текст


в server.cfg устанавливаете значение:
sv_alltalk "1"

в amxx.cfg вбиваете след:
vm_alives 0
vm_deads 2

При таком раскладе получится след:

Живые КТ слышат только живых КТ
Живые Т слышат только живых Т
Мёртвые КТ слышат всех
Мёртвые Т слышат всех


Ниже тот же плагин, но без уведомлений в чат.
Отдельное спасибо wopox3


UPD.

Плагин от товарища Stimul. ( voice_manager.sma )

* v1.6
* живые СТ слышат живых СТ, Т
* живые Т слышат живых Т, СТ
* мертвые СТ слышат всех
* мертвые Т слышат всех
* инфа 5 сек
* админы слышат всех и могут говорить всем
* флаг для админа ADMIN_BAN

Отредактировал: adva, - 13.5.2015, 18:12
Прикрепленные файлы:
Прикрепленный файл  Voices_Management.rar ( 3,35 килобайт ) Кол-во скачиваний: 928
Прикрепленный файл  voice_manager.sma ( 2,83 килобайт ) Кол-во скачиваний: 623
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 7 раз
   Цитировать сообщение
Статус пользователя f1nik
сообщение 24.3.2014, 14:37
Сообщение #2


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

Стаж: 15 лет

Сообщений: 1862
Благодарностей: 932
Полезность: 1010

Русифицированный lang к данному плагину, русифицировал сам, но года 3 назад, вроде плагин не менялся за это время!
Прикрепленный файл  voicesmanagement.txt ( 3,81 килобайт ) Кол-во скачиваний: 834
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 3 раз
   + Цитировать сообщение
Статус пользователя ex3m777
сообщение 24.3.2014, 15:36
Сообщение #3


Стаж: 13 лет
Город: Москва

Сообщений: 2037
Благодарностей: 1135
Полезность: 968

Меценат Меценат

ну раз пошла такая пьянка вот обнова

Код:
// Required admin access level
#define ADMIN_VOICE ADMIN_CHAT

// Delay before a connected player see the text announce
#define ANNOUNCE_TASK_DELAY 30.0

// Comment this out if you don't want that a "no sound" player can hear admins using +adminvoice
// All other player settings are respected whatever this is commented or not.
// #define SUPER_ADMIN_PRIORITY

/* ** END OF EDITABLE ** */

/* Changelog
*
* v1.1.0 (10/23/13)
* -cleaned up code
*
* v1.0.2 (04/19/08)
* -few code corrections
* -updated player spawn detection
* -added HLTV & BOT checks
*
* v1.0.1 (03/31/08)
* -added colored chat
* -added chat command /vm that display voices settings
* -inform new players about /vm command
* -display adminlisten status when toggle_adminlisten command is used
* -added support for amx_show_activity cvar on amx_(un)mute command
*
* v1.0.0 (03/26/08)
* First release
*
*/

/*
Flags :
1 : hear dead terrorists
2 : hear alive terrorists
4 : hear dead cts
8 : hear alive cts
16 : hear specs
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#pragma semicolon 1

#define VERSION "1.1.alpha"

#define cm(%0) ( sizeof(%0) - 1 )

#define MaskPlayerVoice(%0) ( 1<<((%0-1) & 31) )

enum _:mStates
{
DEAD_T,
ALIVE_T,
DEAD_CT,
ALIVE_CT,
SPEC
}

enum _:mStatesFlags ( <<= 1 )
{
FL_DEAD_T = 1,
FL_ALIVE_T,
FL_DEAD_CT,
FL_ALIVE_CT,
FL_SPEC
}

const MAX_PLAYERS = 32;

const m_iTeam = 114;
const TEAM_T = 1;
const TEAM_CT = 2;

new g_bHasVoicesOn[33 char];
new g_bitBannedClients[33];
#define CanPlayerHearPlayer(%0,%1) ( ~g_bitBannedClients[%0] & MaskPlayerVoice(%1) )

new g_iAdminVoice;
new g_bAdmin[33 char];
new g_bInterAdminVoice[33 char];
new g_bAdminListen[33 char];

new g_bMuted[33 char];
new g_szClientsIp[MAX_PLAYERS+1][22];
new Trie:g_tMutedPlayersIps;

new g_iMaxPlayers;
new g_pcvarVoicesRules[mStates];
new g_amx_show_activity;

public plugin_init()
{
register_plugin("Voices Management", VERSION, "ConnorMcLeod");
register_dictionary("voicesmanagement.txt");
register_dictionary("common.txt");

g_pcvarVoicesRules[DEAD_T] = register_cvar("amx_vm_dead_t", "abcde");
g_pcvarVoicesRules[ALIVE_T] = register_cvar("amx_vm_alive_t", "bd");
g_pcvarVoicesRules[DEAD_CT] = register_cvar("amx_vm_dead_ct", "abcde");
g_pcvarVoicesRules[ALIVE_CT] = register_cvar("amx_vm_alive_ct", "bd");
g_pcvarVoicesRules[SPEC] = register_cvar("amx_vm_spec", "abcde");

register_forward(FM_Voice_SetClientListening, "OnVoice_SetClientListening");

register_clcmd("VModEnable", "ClCmd_VModEnable");
register_clcmd("vban", "ClCmd_vban");

register_clcmd("+adminvoice", "AdminCommand_VoiceOn");
register_clcmd("-adminvoice", "AdminCommand_VoiceOff");

register_clcmd("+interadminvoice", "AdminCommand_InterAdminOn");
register_clcmd("-interadminvoice", "AdminCommand_InterAdminOff");

register_clcmd("+adminlisten", "AdminCommand_ListenOn");
register_clcmd("-adminlisten", "AdminCommand_ListenOff");
register_clcmd("toggle_adminlisten", "AdminCommand_ListenToggle");

register_concmd("amx_mute", "AdminCommand_Mute", ADMIN_VOICE, "<name/#userid>");
register_concmd("amx_unmute", "AdminCommand_UnMute", ADMIN_VOICE, "<name/#userid>");

// register_clcmd("say /vm", "ClCmd_SayStatus");
// register_clcmd("say_team /vm", "ClCmd_SayStatus");
}

public plugin_cfg()
{
g_iMaxPlayers = get_maxplayers();
g_tMutedPlayersIps = TrieCreate();
g_amx_show_activity = get_cvar_pointer("amx_show_activity");
if( g_amx_show_activity )
{
g_amx_show_activity = register_cvar("amx_show_activity", "2");
}
}

// public ClCmd_SayStatus(id)
// {
// new iDeads = get_pcvar_num(g_pcvarDeadsHear),
// iAlives = get_pcvar_num(g_pcvarAlivesHear);

// new szDeadsStatus[18], szAlivesStatus[19];

// switch( iAlives )
// {
// case 0:szAlivesStatus = "VM_ALIVES_TEAMATES";
// case 1:szAlivesStatus = "VM_ALIVES";
// case 2:szAlivesStatus = "VM_ALL";
// }

// switch( iDeads )
// {
// case 0:szDeadsStatus = "VM_DEADS_TEAMATES";
// case 1:szDeadsStatus = "VM_DEADS";
// case 2:szDeadsStatus = "VM_ALL";
// }

// client_print_color(id, id, "%L", id, "VM_ALIVES_STATUS", id, szAlivesStatus);
// client_print_color(id, id, "%L", id, "VM_DEADS_STATUS", id, szDeadsStatus);
// }

// public taskAnnounce(id)
// {
// if( is_user_connected(id) )
// {
// client_print_color(id, id, "%L", id, "VM_ANNOUCE");
// }
// }

public client_authorized(id)
{
g_bAdmin{ id } = bool:(get_user_flags(id) & ADMIN_VOICE);
}

public client_putinserver(id)
{
g_bAdminListen{ id } = false;
g_bInterAdminVoice{ id } = false;

if(is_user_bot(id) || is_user_hltv(id))
return;

static szIp[22];
get_user_ip(id, szIp, cm(szIp));
g_szClientsIp[id] = szIp;

if( TrieKeyExists(g_tMutedPlayersIps, szIp) )
{
g_bMuted{ id } = true;
TrieDeleteKey(g_tMutedPlayersIps, szIp);
}

// set_task(ANNOUNCE_TASK_DELAY, "taskAnnounce", id);
}

public client_disconnect(id)
{
if(g_iAdminVoice == id)
{
g_iAdminVoice = 0;
}
if(g_bMuted{ id })
{
TrieSetCell(g_tMutedPlayersIps, g_szClientsIp[id], 1);
g_bMuted{ id } = false;
}
}

public ClCmd_VModEnable(id)
{
if( read_argc() >= 2 )
{
new arg[32];
read_argv(1, arg, cm(arg));
g_bHasVoicesOn{ id } = !!str_to_num(arg);
}
}

public ClCmd_vban(id)
{
if( read_argc() >= 2 )
{
new arg[32];
read_argv(1, arg, cm(arg));
g_bitBannedClients[id] = strtol(arg, .base = 16);
}
}

public OnVoice_SetClientListening(id, iSender, bool:bListen)
{
if( !is_user_connected(iSender) )
{
return FMRES_IGNORED;
}
static bool:bShouldListen;
bShouldListen = false;
#if defined SUPER_ADMIN_PRIORITY
if(g_iAdminVoice)
{
bShouldListen = (g_iAdminVoice == iSender);
}
else if( !g_bHasVoicesOn{ id } || CanPlayerHearPlayer(id, iSender) )
{
return FMRES_IGNORED;
}
#else
if( !g_bHasVoicesOn{ id } || CanPlayerHearPlayer(id, iSender) )
{
return FMRES_IGNORED;
}
else if(g_iAdminVoice)
{
bShouldListen = (g_iAdminVoice == iSender);
}
#endif
else if( !g_bMuted{ iSender } )
{
if( g_bInterAdminVoice{ iSender } )
{
bShouldListen = !!g_bAdmin{ id };
}
else if(g_bAdminListen{ id })
{
bShouldListen = true;
}
else
{
static pcvar;
switch( get_pdata_int(id, m_iTeam) )
{
case TEAM_T:
{
pcvar = g_pcvarVoicesRules[ is_user_alive(id) ? ALIVE_T : DEAD_T];
}
case TEAM_CT:
{
pcvar = g_pcvarVoicesRules[ is_user_alive(id) ? ALIVE_CT : DEAD_CT];
}
default:
{
pcvar = g_pcvarVoicesRules[SPEC];
}
}

static szRules[6], iRules;
get_pcvar_string(pcvar, szRules, cm(szRules));
iRules = read_flags(szRules);

switch( get_pdata_int(iSender, m_iTeam) )
{
case TEAM_T:
{
bShouldListen = !!(iRules & ( is_user_alive(iSender) ? FL_ALIVE_T : FL_DEAD_T ));
}
case TEAM_CT:
{
bShouldListen = !!(iRules & ( is_user_alive(iSender) ? FL_ALIVE_CT : FL_DEAD_CT ));
}
default:
{
bShouldListen = !!(iRules & FL_SPEC);
}
}
}
}

if( bShouldListen != bListen )
{
forward_return
(
FMV_CELL,
engfunc(EngFunc_SetClientListening, id, iSender, bShouldListen)
);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}

public AdminCommand_ListenOn(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

g_bAdminListen{ id } = true;

return PLUGIN_HANDLED;
}

public AdminCommand_ListenOff(id)
{
if( g_bAdminListen{ id } )
{
g_bAdminListen{ id } = false;
}

return PLUGIN_HANDLED;
}

public AdminCommand_ListenToggle(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

g_bAdminListen{ id } = !g_bAdminListen{ id };

client_print_color(id, id, "%L", id, "VM_LISTEN_STATUS", g_bAdminListen{ id } ? "ON" : "OFF");

return PLUGIN_HANDLED;
}

public AdminCommand_VoiceOn(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

if(g_iAdminVoice)
{
client_print_color(id, id, "%L", id, "VM_ALREADY_INUSE");
return PLUGIN_HANDLED;
}

g_iAdminVoice = id;

new name[32];
pev(id, pev_netname, name, cm(name));

for(new player = 1; player <= g_iMaxPlayers; player++)
{
if( is_user_connected(player) && !is_user_hltv(player) && !is_user_bot(player) )
{
client_print_color(player, id, "%L", player, "VM_ADMIN_TALK", name);
}
}

client_cmd(id, "+voicerecord");

return PLUGIN_HANDLED;
}

public AdminCommand_VoiceOff(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

if(g_iAdminVoice != id)
{
client_cmd(id, "-voicerecord");
return PLUGIN_HANDLED;
}

client_cmd(id, "-voicerecord");
g_iAdminVoice = 0;
return PLUGIN_HANDLED;
}

public AdminCommand_InterAdminOn(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

g_bInterAdminVoice{ id } = true;
client_cmd(id, "+voicerecord");

new name[32];
get_user_name(id, name, cm(name));
for(new i=1; i<=g_iMaxPlayers; i++)
{
if( !g_bAdmin{ i } || !is_user_connected(i) )
{
continue;
}
client_print_color(i, id, "%L", i, "VM_INTER_START", name);
}

return PLUGIN_HANDLED;
}

public AdminCommand_InterAdminOff(id)
{
if( !g_bInterAdminVoice{ id } )
return PLUGIN_HANDLED;

g_bInterAdminVoice{ id } = false;
client_cmd(id, "-voicerecord");

new name[32];
get_user_name(id, name, cm(name));
for(new i=1; i<=g_iMaxPlayers; i++)
{
if( !g_bAdmin{ i } || !is_user_connected(i) )
{
continue;
}
client_print_color(i, id, "%L", i, "VM_INTER_STOP", name);
}

return PLUGIN_HANDLED;
}

public AdminCommand_Mute(id, level, cid)
{
if( !cmd_access(id, level, cid, 2, true) )
{
return PLUGIN_HANDLED;
}

new szPlayer[32];
read_argv(1, szPlayer, cm(szPlayer));
new iPlayer = cmd_target(id, szPlayer, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS);

if( !iPlayer )
{
return PLUGIN_HANDLED;
}

if( g_bAdmin{ iPlayer } )
{
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_MUTE_ADMIN");
return PLUGIN_HANDLED;
}

if( g_bMuted{ iPlayer } )
{
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_AR_MUTED");
return PLUGIN_HANDLED;
}

g_bMuted{ iPlayer } = true;
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_MUTED");

if(g_amx_show_activity)
{
new name[32], name2[32];
get_user_name(id, name, cm(name));
get_user_name(iPlayer, name2, cm(name2));
// show_activity_col(id, name, name2, "VM_MUTE_ACTIVITY");
show_activity_key_color(id, "VM_MUTE_ACTIVITY_NO_NAME", "VM_MUTE_ACTIVITY_NAME", name, name2);
}
return PLUGIN_HANDLED;
}

public AdminCommand_UnMute(id, level, cid)
{
if( !cmd_access(id, level, cid, 2, true) )
{
return PLUGIN_HANDLED;
}

new szPlayer[32], iPlayer;
read_argv(1, szPlayer, cm(szPlayer));
iPlayer = cmd_target(id, szPlayer, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS);

if( !iPlayer )
{
return PLUGIN_HANDLED;
}

if( !g_bMuted{ iPlayer } )
{
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_NOT_MUTED");
return PLUGIN_HANDLED;
}

g_bMuted{ iPlayer } = false;
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_UNMUTED");

if(g_amx_show_activity)
{
new name[32], name2[32];
get_user_name(id, name, cm(name));
get_user_name(iPlayer, name2, cm(name2));

// show_activity_col(id, name, name2, "VM_UNMUTE_ACTIVITY");
show_activity_key_color(id, "VM_UNMUTE_ACTIVITY_NO_NAME", "VM_UNMUTE_ACTIVITY_NAME", name, name2);
}

return PLUGIN_HANDLED;
}

show_activity_key_color(sender, const KeyWithoutName[], const KeyWithName[], const ___AdminName[], any:...)
{
// The variable gets used via vformat, but the compiler doesn't know that, so it still cries.
#pragma unused ___AdminName
static activity;
activity = get_show_activity_value();
if( !activity )
{
return;
}

new buffer[512];
new keyfmt[256];
new id;
new players[32];
new num;
new isadmin;
new activityBit = 1<<activity;

get_players(players, num, "ch");
for(--num; num>=0; num--)
{
id = players[num];
isadmin = is_user_admin(id);

if( activity == 2 || (activityBit & 0b1100 && isadmin) ) // show name
{
LookupLangKey(keyfmt, charsmax(keyfmt), KeyWithName, id);
vformat(buffer, charsmax(buffer), keyfmt, 4);
client_print_color(id, sender, "%s", buffer);
}
else if( activity == 1 || (activityBit & 12 /* 0b1100 */ && !isadmin) || (activity == 5 && isadmin ) ) // show without name
{
LookupLangKey(keyfmt, charsmax(keyfmt), KeyWithoutName, id);
// skip the "adminname" argument if not showing name
vformat(buffer, charsmax(buffer), keyfmt, 5);
client_print_color(id, sender, "%s", buffer);
}
}
}

get_show_activity_value()
{
static amx_show_activity;
static const string_amx_show_activity[] = "amx_show_activity";
if (amx_show_activity == 0)
{
amx_show_activity = get_cvar_pointer(string_amx_show_activity);

// if still not found, then register the cvar as a dummy
if (amx_show_activity == 0)
{
amx_show_activity = register_cvar(string_amx_show_activity, "2");
}
}
return get_pcvar_num(amx_show_activity);
}


Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 2 раз
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 24.3.2014, 15:37
Сообщение #4


Стаж: 12 лет

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

grishka444, а что в обнове?
А все увидел. Типа оптимизация...

Отредактировал: Bloo, - 24.3.2014, 15:40
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя sasha431808
сообщение 28.3.2014, 8:56
Сообщение #5
Стаж: 12 лет

Сообщений: 122
Благодарностей: 51
Полезность: 166

Цитата(grishka444 @ 24.3.2014, 17:36) *
ну раз пошла такая пьянка вот обнова

Код:
// Required admin access level
#define ADMIN_VOICE ADMIN_CHAT

// Delay before a connected player see the text announce
#define ANNOUNCE_TASK_DELAY 30.0

// Comment this out if you don't want that a "no sound" player can hear admins using +adminvoice
// All other player settings are respected whatever this is commented or not.
// #define SUPER_ADMIN_PRIORITY

/* ** END OF EDITABLE ** */

/* Changelog
*
* v1.1.0 (10/23/13)
* -cleaned up code
*
* v1.0.2 (04/19/08)
* -few code corrections
* -updated player spawn detection
* -added HLTV & BOT checks
*
* v1.0.1 (03/31/08)
* -added colored chat
* -added chat command /vm that display voices settings
* -inform new players about /vm command
* -display adminlisten status when toggle_adminlisten command is used
* -added support for amx_show_activity cvar on amx_(un)mute command
*
* v1.0.0 (03/26/08)
* First release
*
*/

/*
Flags :
1 : hear dead terrorists
2 : hear alive terrorists
4 : hear dead cts
8 : hear alive cts
16 : hear specs
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#pragma semicolon 1

#define VERSION "1.1.alpha"

#define cm(%0) ( sizeof(%0) - 1 )

#define MaskPlayerVoice(%0) ( 1<<((%0-1) & 31) )

enum _:mStates
{
DEAD_T,
ALIVE_T,
DEAD_CT,
ALIVE_CT,
SPEC
}

enum _:mStatesFlags ( <<= 1 )
{
FL_DEAD_T = 1,
FL_ALIVE_T,
FL_DEAD_CT,
FL_ALIVE_CT,
FL_SPEC
}

const MAX_PLAYERS = 32;

const m_iTeam = 114;
const TEAM_T = 1;
const TEAM_CT = 2;

new g_bHasVoicesOn[33 char];
new g_bitBannedClients[33];
#define CanPlayerHearPlayer(%0,%1) ( ~g_bitBannedClients[%0] & MaskPlayerVoice(%1) )

new g_iAdminVoice;
new g_bAdmin[33 char];
new g_bInterAdminVoice[33 char];
new g_bAdminListen[33 char];

new g_bMuted[33 char];
new g_szClientsIp[MAX_PLAYERS+1][22];
new Trie:g_tMutedPlayersIps;

new g_iMaxPlayers;
new g_pcvarVoicesRules[mStates];
new g_amx_show_activity;

public plugin_init()
{
register_plugin("Voices Management", VERSION, "ConnorMcLeod");
register_dictionary("voicesmanagement.txt");
register_dictionary("common.txt");

g_pcvarVoicesRules[DEAD_T] = register_cvar("amx_vm_dead_t", "abcde");
g_pcvarVoicesRules[ALIVE_T] = register_cvar("amx_vm_alive_t", "bd");
g_pcvarVoicesRules[DEAD_CT] = register_cvar("amx_vm_dead_ct", "abcde");
g_pcvarVoicesRules[ALIVE_CT] = register_cvar("amx_vm_alive_ct", "bd");
g_pcvarVoicesRules[SPEC] = register_cvar("amx_vm_spec", "abcde");

register_forward(FM_Voice_SetClientListening, "OnVoice_SetClientListening");

register_clcmd("VModEnable", "ClCmd_VModEnable");
register_clcmd("vban", "ClCmd_vban");

register_clcmd("+adminvoice", "AdminCommand_VoiceOn");
register_clcmd("-adminvoice", "AdminCommand_VoiceOff");

register_clcmd("+interadminvoice", "AdminCommand_InterAdminOn");
register_clcmd("-interadminvoice", "AdminCommand_InterAdminOff");

register_clcmd("+adminlisten", "AdminCommand_ListenOn");
register_clcmd("-adminlisten", "AdminCommand_ListenOff");
register_clcmd("toggle_adminlisten", "AdminCommand_ListenToggle");

register_concmd("amx_mute", "AdminCommand_Mute", ADMIN_VOICE, "<name/#userid>");
register_concmd("amx_unmute", "AdminCommand_UnMute", ADMIN_VOICE, "<name/#userid>");

// register_clcmd("say /vm", "ClCmd_SayStatus");
// register_clcmd("say_team /vm", "ClCmd_SayStatus");
}

public plugin_cfg()
{
g_iMaxPlayers = get_maxplayers();
g_tMutedPlayersIps = TrieCreate();
g_amx_show_activity = get_cvar_pointer("amx_show_activity");
if( g_amx_show_activity )
{
g_amx_show_activity = register_cvar("amx_show_activity", "2");
}
}

// public ClCmd_SayStatus(id)
// {
// new iDeads = get_pcvar_num(g_pcvarDeadsHear),
// iAlives = get_pcvar_num(g_pcvarAlivesHear);

// new szDeadsStatus[18], szAlivesStatus[19];

// switch( iAlives )
// {
// case 0:szAlivesStatus = "VM_ALIVES_TEAMATES";
// case 1:szAlivesStatus = "VM_ALIVES";
// case 2:szAlivesStatus = "VM_ALL";
// }

// switch( iDeads )
// {
// case 0:szDeadsStatus = "VM_DEADS_TEAMATES";
// case 1:szDeadsStatus = "VM_DEADS";
// case 2:szDeadsStatus = "VM_ALL";
// }

// client_print_color(id, id, "%L", id, "VM_ALIVES_STATUS", id, szAlivesStatus);
// client_print_color(id, id, "%L", id, "VM_DEADS_STATUS", id, szDeadsStatus);
// }

// public taskAnnounce(id)
// {
// if( is_user_connected(id) )
// {
// client_print_color(id, id, "%L", id, "VM_ANNOUCE");
// }
// }

public client_authorized(id)
{
g_bAdmin{ id } = bool:(get_user_flags(id) & ADMIN_VOICE);
}

public client_putinserver(id)
{
g_bAdminListen{ id } = false;
g_bInterAdminVoice{ id } = false;

if(is_user_bot(id) || is_user_hltv(id))
return;

static szIp[22];
get_user_ip(id, szIp, cm(szIp));
g_szClientsIp[id] = szIp;

if( TrieKeyExists(g_tMutedPlayersIps, szIp) )
{
g_bMuted{ id } = true;
TrieDeleteKey(g_tMutedPlayersIps, szIp);
}

// set_task(ANNOUNCE_TASK_DELAY, "taskAnnounce", id);
}

public client_disconnect(id)
{
if(g_iAdminVoice == id)
{
g_iAdminVoice = 0;
}
if(g_bMuted{ id })
{
TrieSetCell(g_tMutedPlayersIps, g_szClientsIp[id], 1);
g_bMuted{ id } = false;
}
}

public ClCmd_VModEnable(id)
{
if( read_argc() >= 2 )
{
new arg[32];
read_argv(1, arg, cm(arg));
g_bHasVoicesOn{ id } = !!str_to_num(arg);
}
}

public ClCmd_vban(id)
{
if( read_argc() >= 2 )
{
new arg[32];
read_argv(1, arg, cm(arg));
g_bitBannedClients[id] = strtol(arg, .base = 16);
}
}

public OnVoice_SetClientListening(id, iSender, bool:bListen)
{
if( !is_user_connected(iSender) )
{
return FMRES_IGNORED;
}
static bool:bShouldListen;
bShouldListen = false;
#if defined SUPER_ADMIN_PRIORITY
if(g_iAdminVoice)
{
bShouldListen = (g_iAdminVoice == iSender);
}
else if( !g_bHasVoicesOn{ id } || CanPlayerHearPlayer(id, iSender) )
{
return FMRES_IGNORED;
}
#else
if( !g_bHasVoicesOn{ id } || CanPlayerHearPlayer(id, iSender) )
{
return FMRES_IGNORED;
}
else if(g_iAdminVoice)
{
bShouldListen = (g_iAdminVoice == iSender);
}
#endif
else if( !g_bMuted{ iSender } )
{
if( g_bInterAdminVoice{ iSender } )
{
bShouldListen = !!g_bAdmin{ id };
}
else if(g_bAdminListen{ id })
{
bShouldListen = true;
}
else
{
static pcvar;
switch( get_pdata_int(id, m_iTeam) )
{
case TEAM_T:
{
pcvar = g_pcvarVoicesRules[ is_user_alive(id) ? ALIVE_T : DEAD_T];
}
case TEAM_CT:
{
pcvar = g_pcvarVoicesRules[ is_user_alive(id) ? ALIVE_CT : DEAD_CT];
}
default:
{
pcvar = g_pcvarVoicesRules[SPEC];
}
}

static szRules[6], iRules;
get_pcvar_string(pcvar, szRules, cm(szRules));
iRules = read_flags(szRules);

switch( get_pdata_int(iSender, m_iTeam) )
{
case TEAM_T:
{
bShouldListen = !!(iRules & ( is_user_alive(iSender) ? FL_ALIVE_T : FL_DEAD_T ));
}
case TEAM_CT:
{
bShouldListen = !!(iRules & ( is_user_alive(iSender) ? FL_ALIVE_CT : FL_DEAD_CT ));
}
default:
{
bShouldListen = !!(iRules & FL_SPEC);
}
}
}
}

if( bShouldListen != bListen )
{
forward_return
(
FMV_CELL,
engfunc(EngFunc_SetClientListening, id, iSender, bShouldListen)
);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}

public AdminCommand_ListenOn(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

g_bAdminListen{ id } = true;

return PLUGIN_HANDLED;
}

public AdminCommand_ListenOff(id)
{
if( g_bAdminListen{ id } )
{
g_bAdminListen{ id } = false;
}

return PLUGIN_HANDLED;
}

public AdminCommand_ListenToggle(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

g_bAdminListen{ id } = !g_bAdminListen{ id };

client_print_color(id, id, "%L", id, "VM_LISTEN_STATUS", g_bAdminListen{ id } ? "ON" : "OFF");

return PLUGIN_HANDLED;
}

public AdminCommand_VoiceOn(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

if(g_iAdminVoice)
{
client_print_color(id, id, "%L", id, "VM_ALREADY_INUSE");
return PLUGIN_HANDLED;
}

g_iAdminVoice = id;

new name[32];
pev(id, pev_netname, name, cm(name));

for(new player = 1; player <= g_iMaxPlayers; player++)
{
if( is_user_connected(player) && !is_user_hltv(player) && !is_user_bot(player) )
{
client_print_color(player, id, "%L", player, "VM_ADMIN_TALK", name);
}
}

client_cmd(id, "+voicerecord");

return PLUGIN_HANDLED;
}

public AdminCommand_VoiceOff(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

if(g_iAdminVoice != id)
{
client_cmd(id, "-voicerecord");
return PLUGIN_HANDLED;
}

client_cmd(id, "-voicerecord");
g_iAdminVoice = 0;
return PLUGIN_HANDLED;
}

public AdminCommand_InterAdminOn(id)
{
if( !g_bAdmin{ id } )
{
return PLUGIN_HANDLED;
}

g_bInterAdminVoice{ id } = true;
client_cmd(id, "+voicerecord");

new name[32];
get_user_name(id, name, cm(name));
for(new i=1; i<=g_iMaxPlayers; i++)
{
if( !g_bAdmin{ i } || !is_user_connected(i) )
{
continue;
}
client_print_color(i, id, "%L", i, "VM_INTER_START", name);
}

return PLUGIN_HANDLED;
}

public AdminCommand_InterAdminOff(id)
{
if( !g_bInterAdminVoice{ id } )
return PLUGIN_HANDLED;

g_bInterAdminVoice{ id } = false;
client_cmd(id, "-voicerecord");

new name[32];
get_user_name(id, name, cm(name));
for(new i=1; i<=g_iMaxPlayers; i++)
{
if( !g_bAdmin{ i } || !is_user_connected(i) )
{
continue;
}
client_print_color(i, id, "%L", i, "VM_INTER_STOP", name);
}

return PLUGIN_HANDLED;
}

public AdminCommand_Mute(id, level, cid)
{
if( !cmd_access(id, level, cid, 2, true) )
{
return PLUGIN_HANDLED;
}

new szPlayer[32];
read_argv(1, szPlayer, cm(szPlayer));
new iPlayer = cmd_target(id, szPlayer, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS);

if( !iPlayer )
{
return PLUGIN_HANDLED;
}

if( g_bAdmin{ iPlayer } )
{
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_MUTE_ADMIN");
return PLUGIN_HANDLED;
}

if( g_bMuted{ iPlayer } )
{
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_AR_MUTED");
return PLUGIN_HANDLED;
}

g_bMuted{ iPlayer } = true;
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_MUTED");

if(g_amx_show_activity)
{
new name[32], name2[32];
get_user_name(id, name, cm(name));
get_user_name(iPlayer, name2, cm(name2));
// show_activity_col(id, name, name2, "VM_MUTE_ACTIVITY");
show_activity_key_color(id, "VM_MUTE_ACTIVITY_NO_NAME", "VM_MUTE_ACTIVITY_NAME", name, name2);
}
return PLUGIN_HANDLED;
}

public AdminCommand_UnMute(id, level, cid)
{
if( !cmd_access(id, level, cid, 2, true) )
{
return PLUGIN_HANDLED;
}

new szPlayer[32], iPlayer;
read_argv(1, szPlayer, cm(szPlayer));
iPlayer = cmd_target(id, szPlayer, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS);

if( !iPlayer )
{
return PLUGIN_HANDLED;
}

if( !g_bMuted{ iPlayer } )
{
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_NOT_MUTED");
return PLUGIN_HANDLED;
}

g_bMuted{ iPlayer } = false;
client_print(id, print_console, "%L", id ? id : LANG_SERVER, "VM_UNMUTED");

if(g_amx_show_activity)
{
new name[32], name2[32];
get_user_name(id, name, cm(name));
get_user_name(iPlayer, name2, cm(name2));

// show_activity_col(id, name, name2, "VM_UNMUTE_ACTIVITY");
show_activity_key_color(id, "VM_UNMUTE_ACTIVITY_NO_NAME", "VM_UNMUTE_ACTIVITY_NAME", name, name2);
}

return PLUGIN_HANDLED;
}

show_activity_key_color(sender, const KeyWithoutName[], const KeyWithName[], const ___AdminName[], any:...)
{
// The variable gets used via vformat, but the compiler doesn't know that, so it still cries.
#pragma unused ___AdminName
static activity;
activity = get_show_activity_value();
if( !activity )
{
return;
}

new buffer[512];
new keyfmt[256];
new id;
new players[32];
new num;
new isadmin;
new activityBit = 1<<activity;

get_players(players, num, "ch");
for(--num; num>=0; num--)
{
id = players[num];
isadmin = is_user_admin(id);

if( activity == 2 || (activityBit & 0b1100 && isadmin) ) // show name
{
LookupLangKey(keyfmt, charsmax(keyfmt), KeyWithName, id);
vformat(buffer, charsmax(buffer), keyfmt, 4);
client_print_color(id, sender, "%s", buffer);
}
else if( activity == 1 || (activityBit & 12 /* 0b1100 */ && !isadmin) || (activity == 5 && isadmin ) ) // show without name
{
LookupLangKey(keyfmt, charsmax(keyfmt), KeyWithoutName, id);
// skip the "adminname" argument if not showing name
vformat(buffer, charsmax(buffer), keyfmt, 5);
client_print_color(id, sender, "%s", buffer);
}
}
}

get_show_activity_value()
{
static amx_show_activity;
static const string_amx_show_activity[] = "amx_show_activity";
if (amx_show_activity == 0)
{
amx_show_activity = get_cvar_pointer(string_amx_show_activity);

// if still not found, then register the cvar as a dummy
if (amx_show_activity == 0)
{
amx_show_activity = register_cvar(string_amx_show_activity, "2");
}
}
return get_pcvar_num(amx_show_activity);
}


Ошибка компиляции плагина! (использовался компилятор "AMX Mod X 1.8.1")

Voices_Management.sma(230) : error 017: undefined symbol "strtol"
Voices_Management.sma(230) : warning 215: expression has no effect
Voices_Management.sma(230) : error 001: expected token: ";", but found ")"
Voices_Management.sma(230) : error 029: invalid expression, assumed zero
Voices_Management.sma(230) : fatal error 107: too many error messages on one line
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя X*CaHeK*X
сообщение 28.3.2014, 9:12
Сообщение #6
Стаж: 17 лет

Сообщений: 705
Благодарностей: 225
Полезность: 561

Скрытый текст
Никаких проблем с компиляцией. 1.8.3 dev-185
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя sasha431808
сообщение 28.3.2014, 11:07
Сообщение #7
Стаж: 12 лет

Сообщений: 122
Благодарностей: 51
Полезность: 166

Сори, разобрался эта обнова для amxx 1.8.3
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя sasha431808
сообщение 28.3.2014, 11:50
Сообщение #8
Стаж: 12 лет

Сообщений: 122
Благодарностей: 51
Полезность: 166

Как включить настройки?
Я так понял есть возможность чтоб админы слышали всех игроков и админы слышат админов(игроки их не слышат), что для этово нужно прописать в консоле??
Буду весьма благодарен
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 28.3.2014, 11:57
Сообщение #9


Стаж: 12 лет

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

sasha431808, прочитать описание плагина? Не? https://forums.alliedmods.net/showthread.php?t=69006?t=69006
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя BornToBeFree
сообщение 28.3.2014, 20:20
Сообщение #10


Стаж: 12 лет

Сообщений: 741
Благодарностей: 287
Полезность: 602

Меценат Меценат

Цитата(grishka444 @ 24.3.2014, 17:36) *
ну раз пошла такая пьянка вот обнова

А как здесь настраивается? Чтобы можно было настроить кто кого может слышать. Типо как в прошлой версии...

Код:
g_pcvarAlivesHear = register_cvar("vm_alives", "1")  // 0:alive teamates , 1:alives , 2:all
g_pcvarDeadsHear = register_cvar("vm_deads", "2") // 0:dead teamates , 1:deads , 2:all


Скидка 5% при заказе сервера
Чтобы получить 5% скидку при заказе сервера на хостинге Serva4ok.ru
Необходимо ввести это кодовое слово gKUt-FENO-ZonE-aIaa
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 28.3.2014, 20:28
Сообщение #11


Стаж: 12 лет

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

ExTPuMaJI, ну почему так трудно перейти на первоисточник и посмотреть описание?
Цитата
.: Cvars :.

vm_alives < 0|1|2 >
Alive players hear : 0:alive teamates - 1:alive players - 2:all players(def: 1)
vm_deads < 0|1|2 >
Dead players hear : 0:dead teamates - 1:dead players - 2:all players(def: 2)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя BornToBeFree
сообщение 28.3.2014, 20:33
Сообщение #12


Стаж: 12 лет

Сообщений: 741
Благодарностей: 287
Полезность: 602

Меценат Меценат

Найди теперь мне эти строки в обновленном плагине?


Скидка 5% при заказе сервера
Чтобы получить 5% скидку при заказе сервера на хостинге Serva4ok.ru
Необходимо ввести это кодовое слово gKUt-FENO-ZonE-aIaa
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 28.3.2014, 20:46
Сообщение #13


Стаж: 12 лет

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

ExTPuMaJI, вы тогда уточняйте о каком плагине говорите.
Код:
   g_pcvarVoicesRules[DEAD_T] = register_cvar("amx_vm_dead_t", "abcde"); //Кого слышат мертвые Т
g_pcvarVoicesRules[ALIVE_T] = register_cvar("amx_vm_alive_t", "bd"); //Кого слышат живые Т
g_pcvarVoicesRules[DEAD_CT] = register_cvar("amx_vm_dead_ct", "abcde"); //Кого слышат мертвые CT
g_pcvarVoicesRules[ALIVE_CT] = register_cvar("amx_vm_alive_ct", "bd"); //Кого слышат живые CТ
g_pcvarVoicesRules[SPEC] = register_cvar("amx_vm_spec", "abcde"); //Кого слышат спектры

Описание флагов:
a : Мертвые Т
b : Живые Т
c : Мертвые СТ
d : Живые СТ
e : Спектры

ps.gif Все это в той же теме на оленях, стоит лишь почитать последние страницы.

Отредактировал: Bloo, - 28.3.2014, 20:52
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя BornToBeFree
сообщение 28.3.2014, 21:23
Сообщение #14


Стаж: 12 лет

Сообщений: 741
Благодарностей: 287
Полезность: 602

Меценат Меценат

Хм, а где взять версию amxx 1.8.3 чтобы скомпилировать?


Скидка 5% при заказе сервера
Чтобы получить 5% скидку при заказе сервера на хостинге Serva4ok.ru
Необходимо ввести это кодовое слово gKUt-FENO-ZonE-aIaa
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 28.3.2014, 21:34
Сообщение #15


Стаж: 12 лет

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

ExTPuMaJI, http://www.amxmodx.org/snapshots.php
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 29.3.2014, 13:17
Сообщение #16


Стаж: 12 лет

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

У кого проблемы с компиляцией, используйте исходник с оленей https://forums.alliedmods.net/showpost.php?...p;postcount=116 , т.к. при копировании от сюда вылазят ошибки, думаю проблема с кодировкой.
Прикрепленные файлы:
Прикрепленный файл  voices_management.sma ( 13,11 килобайт ) Кол-во скачиваний: 104
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя wopox3
сообщение 31.3.2014, 8:41
Сообщение #17


Стаж: 13 лет

Сообщений: 333
Благодарностей: 222
Полезность: 902

Вот новая версия требующая amx 1.8.3.

https://forums.alliedmods.net/showpost.php?...p;postcount=116

Это для тех, кто не верит, что она от автора.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 31.3.2014, 8:59
Сообщение #18


Стаж: 12 лет

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

wopox3, я как бы постом выше дал эту ссылку)))
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Paxila
сообщение 9.4.2014, 18:15
Сообщение #19


Стаж: 12 лет

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

А как сделать чтобы все слышали друг друга, но когда ты мёртвый то тебя не слышат живые но слышат мёртвые ? help.gif huh.gif
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
etkins
сообщение 9.4.2014, 18:56
Сообщение #20
Стаж: 17 лет

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

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