Tiim Rääkivus

Vaata eelmist teemat Vaata järgmist teemat Go down

avatar
ѕααтαη
Juunior
Postitusi : 18
Maine : 0
Liitus : 14/10/2015
Vaata kasutaja profiili

Postitamineѕααтαη on 22.12.15 20:15

Terve, kuidas saaks nii, et terroristid kuuleksid mikriga ainult terroriste & vastupidi?


avatar
Suki
Juunior
Postitusi : 18
Maine : 0
Liitus : 25/03/2015
Vaata kasutaja profiili

PostitamineSuki on 22.12.15 20:37

sv_alltalk 0 vist


avatar
ѕααтαη
Juunior
Postitusi : 18
Maine : 0
Liitus : 14/10/2015
Vaata kasutaja profiili

Postitamineѕααтαη on 22.12.15 21:08

Oligi, suured tänud sulle.
Nii loll olen,et ei suutnud nüüd seda väikset viga leida.


avatar
Tehnik aK
Staar
Postitusi : 453
Maine : 16
Liitus : 28/03/2013
Vaata kasutaja profiili

PostitamineTehnik aK on 29.12.15 23:24

Panin sama aga kui surnud räägivad siis elavad ei kuule.
UskuMatu
Veteran
Postitusi : 632
Maine : 41
Liitus : 15/03/2013
Vaata kasutaja profiili

PostitamineUskuMatu on 01.01.16 14:32

@Tehnik aK kirjutas:Panin sama aga kui surnud räägivad siis elavad ei kuule.

Kasutad sa ehk mingit pluginat? Mis segab rääkimist?
avatar
Tonight


Postitusi : 14639
Maine : 2652
Liitus : 19/02/2012
Staatus : @Faval
Vaata kasutaja profiili

PostitamineTonight on 01.01.16 22:28

@Tehnik aK kirjutas:Panin sama aga kui surnud räägivad siis elavad ei kuule.
See plugin peaks aitama: https://forums.alliedmods.net/showthread.php?t=69006

vm_alives 0|1|2
Alive players hear : 0:alive teammates - 1:alive players - 2:all players(def: 1)

vm_deads 0|1|2
Dead players hear : 0:dead teammates - 1:dead players - 2:all players(def: 2)
avatar
ѕααтαη
Juunior
Postitusi : 18
Maine : 0
Liitus : 14/10/2015
Vaata kasutaja profiili

Postitamineѕααтαη on 04.01.16 17:45

@TONIGHT Ei tööta!


avatar
Tehnik aK
Staar
Postitusi : 453
Maine : 16
Liitus : 28/03/2013
Vaata kasutaja profiili

PostitamineTehnik aK on 06.01.16 14:49

Sooviks väga seda korda saada..
avatar
Tonight


Postitusi : 14639
Maine : 2652
Liitus : 19/02/2012
Staatus : @Faval
Vaata kasutaja profiili

PostitamineTonight on 06.01.16 15:04

Töötab amxx 1.8.3-ga (testisin):

.sma:
Kood:
#define ADMIN_VOICE ADMIN_CHAT
#define ANNOUNCE_TASK_DELAY 30.0
// #define SUPER_ADMIN_PRIORITY

#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);
}

Cvarid:
amx_vm_dead_t "ab"
amx_vm_alive_t "ab"
amx_vm_dead_ct "cd"
amx_vm_alive_ct "cd"
amx_vm_spec "e"

Plugin:
Attachments
CW_voicechat.zip You don't have permission to download attachments.(8 Kb) Downloaded 3 times
avatar
Tehnik aK
Staar
Postitusi : 453
Maine : 16
Liitus : 28/03/2013
Vaata kasutaja profiili

PostitamineTehnik aK on 07.01.16 2:30

TÜRA HUJ TÖÖTAB, PANIN PEALE IKKA EI FUNKA?
Sponsored content

PostitamineSponsored content

Vaata eelmist teemat Vaata järgmist teemat Tagasi üles

Soovid reklaamidest vabaneda?

Selleks logi sisse või tee endale kasutaja.

Liitu foorumiga

Tee endale kasutaja ning osale aruteludes.


Tee uus kasutaja

Logi sisse

Omad foorumis juba kasutajat? Logi sisse.


Logi sisse

 
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele