Bom Pessoal eu estava na net proucurando alguns Plugins e acabei encontrando um plugin muito bom para servidores de zombie ele se chama vote mute ,, e uma votaçao para mutar o player por minutos , segundos e tals
#include < amxmodx >
#include < cstrike >
#include < engine >
#define PLUGIN "Mute Voting"
#define VERSION "1.4"
#define AUTHOR "Jon"
#define IsMuted(%1) (get_speak(%1) & SPEAK_MUTED)
#define ADMIN_FLAG ADMIN_BAN
enum _:Choices
{
VOTE_YES,
VOTE_NO
}
const TASK_UNMUTE = 12940;
new g_pAllTalk, g_pAdminImmunity, g_pCoolDown, g_pDuration, g_pMuteChat, g_pAdminOnly;
new g_iVoteMenu;
new g_iMaxPlayers;
new g_iMsgSayText;
new g_iMutedPlayers;
new g_iVotes[ Choices ];
new g_szSteamId[ 33 ][ 35 ];
new Float:g_fCoolDown[ 33 ];
new Trie:g_tSteamIDs;
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR );
g_iMaxPlayers = get_maxplayers( );
g_iMsgSayText = get_user_msgid( "SayText" );
g_pAdminImmunity = register_cvar( "mv_immunity", "1" );
g_pCoolDown = register_cvar( "mv_cooldown", "120.0" );
g_pDuration = register_cvar( "mv_duration", "480.0" );
g_pMuteChat = register_cvar( "mv_mutechat", "0" );
g_pAdminOnly = register_cvar( "mv_adminonly", "0" );
g_pAllTalk = get_cvar_pointer( "sv_alltalk" );
register_clcmd( "say", "CmdSay" );
register_clcmd( "say /votemute", "ShowPlayerMenu" );
register_clcmd( "say /mutevote", "ShowPlayerMenu" );
g_tSteamIDs = TrieCreate( );
}
public plugin_end( )
{
TrieDestroy( g_tSteamIDs );
}
public client_putinserver( iClient )
{
get_user_authid( iClient, g_szSteamId[ iClient ], 34 );
if( TrieKeyExists( g_tSteamIDs, g_szSteamId[ iClient ] ) )
{
set_speak( iClient, SPEAK_MUTED );
}
}
public CmdSay( iClient )
{
if( get_pcvar_num( g_pMuteChat ) && IsMuted( iClient ) )
{
return PLUGIN_HANDLED_MAIN;
}
return PLUGIN_CONTINUE;
}
public ShowPlayerMenu( iClient )
{
if( get_pcvar_num( g_pAdminOnly ) && !( get_user_flags( iClient ) & ADMIN_FLAG ) )
{
PrintColor( iClient, "Only admins can start mute votes." );
return PLUGIN_HANDLED;
}
new iMenu = menu_create( "Select a player", "HandlePlayerMenu" ), szMenuText[ 33 ], szName[ 33 ], szNum[ 2 ];
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( !is_user_connected( i ) )
{
continue;
}
get_user_name( i, szName, 32 );
num_to_str( i, szNum, 1 );
if( IsMuted( i )
|| get_pcvar_num( g_pAdminImmunity ) && get_user_flags( i ) & ADMIN_FLAG
|| !get_pcvar_num( g_pAllTalk ) && cs_get_user_team( iClient ) != cs_get_user_team( i ) )
{
formatex( szMenuText, 32, "\d%s", szName );
menu_additem( iMenu, szMenuText, szNum );
}
else
{
menu_additem( iMenu, szName, szNum );
}
}
menu_display( iClient, iMenu );
}
public HandlePlayerMenu( iClient, iMenu, iItem )
{
if( iItem == MENU_EXIT )
{
return PLUGIN_HANDLED;
}
new _dummy, szPlayer[ 3 ];
menu_item_getinfo( iMenu, iItem, _dummy, szPlayer, 2, "", 0, _dummy );
new iPlayer = str_to_num( szPlayer ), Float:fTime = get_gametime( );
if( g_iVoteMenu > 0 )
{
PrintColor( iClient, "There is already an ongoing vote." );
}
else if( g_fCoolDown[ iClient ] > fTime )
{
PrintColor( iClient, "You started a mute vote recently, try again in %.1f seconds.", g_fCoolDown[ iClient ] - fTime );
}
else if( !get_pcvar_num( g_pAllTalk ) && cs_get_user_team( iClient ) != cs_get_user_team( iPlayer ) )
{
PrintColor( iClient, "This player isn't in your team (alltalk isn't enabled)." );
}
else if( IsMuted( iPlayer ) )
{
PrintColor( iClient, "This player is already muted." );
}
else if( get_pcvar_num( g_pAdminImmunity ) && get_user_flags( iPlayer ) & ADMIN_FLAG )
{
PrintColor( iClient, "You can't start a vote against admins." );
}
else
{
ShowVoteMenu( iPlayer );
set_task( 12.0, "TaskEndVote", iPlayer );
g_fCoolDown[ iClient ] = fTime + get_pcvar_float( g_pCoolDown );
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
menu_destroy( iMenu );
ShowPlayerMenu( iClient );
return PLUGIN_HANDLED;
}
ShowVoteMenu( iTarget )
{
new szName[ 33 ], szMenu[ 40 ];
get_user_name( iTarget, szName, 32 );
formatex( szMenu, 39, "Mute %s?", szName );
g_iVoteMenu = menu_create( szMenu, "HandleVoteMenu" );
menu_additem( g_iVoteMenu, "Yes", "1" );
menu_additem( g_iVoteMenu, "No", "2" );
menu_setprop( g_iVoteMenu, MPROP_EXIT, MEXIT_NEVER );
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( !is_user_connected( i ) || i == iTarget || !get_pcvar_num( g_pAllTalk ) && cs_get_user_team( i ) != cs_get_user_team( iTarget ) )
{
continue;
}
menu_display( i, g_iVoteMenu );
}
}
public HandleVoteMenu( iClient, iMenu, iItem )
{
if( iItem == MENU_EXIT || !g_iVoteMenu )
{
return PLUGIN_HANDLED;
}
new _dummy, szChoice[ 2 ];
menu_item_getinfo( iMenu, iItem, _dummy, szChoice, 1, "", 0, _dummy );
g_iVotes[ str_to_num( szChoice ) - 1 ]++;
return PLUGIN_HANDLED;
}
public TaskEndVote( iTarget )
{
PrintColor( 0, "The vote has ended. Yes: %i - No: %i", g_iVotes[ VOTE_YES ], g_iVotes[ VOTE_NO ] );
new szName[ 33 ];
get_user_name( iTarget, szName, 32 );
if( g_iVotes[ VOTE_YES ] < g_iVotes[ VOTE_NO ] || !g_iVotes[ VOTE_YES ] && !g_iVotes[ VOTE_NO ] )
{
PrintColor( 0, "%s was not muted.", szName );
}
else
{
PrintColor( 0, "%s was muted.", szName );
TrieSetCell( g_tSteamIDs, g_szSteamId[ iTarget ], g_iMutedPlayers++ );
set_speak( iTarget, SPEAK_MUTED );
set_task( get_pcvar_float( g_pDuration ), "TaskUnmute", iTarget + TASK_UNMUTE,
g_szSteamId[ iTarget ], 34 );
}
menu_destroy( g_iVoteMenu );
g_iVotes[ VOTE_YES ] = 0;
g_iVotes[ VOTE_NO ] = 0;
g_iVoteMenu = 0;
}
public TaskUnmute( szAuthId[ ] )
{
TrieDeleteKey( g_tSteamIDs, szAuthId );
g_iMutedPlayers--;
new iClient = find_player( "c", szAuthId );
if( iClient > 0 )
{
new szName[ 33 ];
get_user_name( iClient, szName, 32 );
PrintColor( 0, "%s is no longer muted.", szName );
}
}
PrintColor( iClient, szText[], any:... )
{
new szMsg[ 191 ];
formatex( szMsg, 190, "^x04-|^x01 " );
vformat( szMsg[ 5 ], 185, szText, 3 );
message_begin( iClient ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgSayText, _, iClient );
write_byte( 1 );
write_string( szMsg );
message_end();
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1044\\ f0\\ fs16 \n\\ par }
*/
Creditos : Jon
Nao Traduzi o Plugin (Ele esta em ingles)
SMA AKI :
#include < amxmodx >
#include < cstrike >
#include < engine >
#define PLUGIN "Mute Voting"
#define VERSION "1.4"
#define AUTHOR "Jon"
#define IsMuted(%1) (get_speak(%1) & SPEAK_MUTED)
#define ADMIN_FLAG ADMIN_BAN
enum _:Choices
{
VOTE_YES,
VOTE_NO
}
const TASK_UNMUTE = 12940;
new g_pAllTalk, g_pAdminImmunity, g_pCoolDown, g_pDuration, g_pMuteChat, g_pAdminOnly;
new g_iVoteMenu;
new g_iMaxPlayers;
new g_iMsgSayText;
new g_iMutedPlayers;
new g_iVotes[ Choices ];
new g_szSteamId[ 33 ][ 35 ];
new Float:g_fCoolDown[ 33 ];
new Trie:g_tSteamIDs;
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR );
g_iMaxPlayers = get_maxplayers( );
g_iMsgSayText = get_user_msgid( "SayText" );
g_pAdminImmunity = register_cvar( "mv_immunity", "1" );
g_pCoolDown = register_cvar( "mv_cooldown", "120.0" );
g_pDuration = register_cvar( "mv_duration", "480.0" );
g_pMuteChat = register_cvar( "mv_mutechat", "0" );
g_pAdminOnly = register_cvar( "mv_adminonly", "0" );
g_pAllTalk = get_cvar_pointer( "sv_alltalk" );
register_clcmd( "say", "CmdSay" );
register_clcmd( "say /votemute", "ShowPlayerMenu" );
register_clcmd( "say /mutevote", "ShowPlayerMenu" );
g_tSteamIDs = TrieCreate( );
}
public plugin_end( )
{
TrieDestroy( g_tSteamIDs );
}
public client_putinserver( iClient )
{
get_user_authid( iClient, g_szSteamId[ iClient ], 34 );
if( TrieKeyExists( g_tSteamIDs, g_szSteamId[ iClient ] ) )
{
set_speak( iClient, SPEAK_MUTED );
}
}
public CmdSay( iClient )
{
if( get_pcvar_num( g_pMuteChat ) && IsMuted( iClient ) )
{
return PLUGIN_HANDLED_MAIN;
}
return PLUGIN_CONTINUE;
}
public ShowPlayerMenu( iClient )
{
if( get_pcvar_num( g_pAdminOnly ) && !( get_user_flags( iClient ) & ADMIN_FLAG ) )
{
PrintColor( iClient, "Only admins can start mute votes." );
return PLUGIN_HANDLED;
}
new iMenu = menu_create( "Select a player", "HandlePlayerMenu" ), szMenuText[ 33 ], szName[ 33 ], szNum[ 2 ];
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( !is_user_connected( i ) )
{
continue;
}
get_user_name( i, szName, 32 );
num_to_str( i, szNum, 1 );
if( IsMuted( i )
|| get_pcvar_num( g_pAdminImmunity ) && get_user_flags( i ) & ADMIN_FLAG
|| !get_pcvar_num( g_pAllTalk ) && cs_get_user_team( iClient ) != cs_get_user_team( i ) )
{
formatex( szMenuText, 32, "\d%s", szName );
menu_additem( iMenu, szMenuText, szNum );
}
else
{
menu_additem( iMenu, szName, szNum );
}
}
menu_display( iClient, iMenu );
}
public HandlePlayerMenu( iClient, iMenu, iItem )
{
if( iItem == MENU_EXIT )
{
return PLUGIN_HANDLED;
}
new _dummy, szPlayer[ 3 ];
menu_item_getinfo( iMenu, iItem, _dummy, szPlayer, 2, "", 0, _dummy );
new iPlayer = str_to_num( szPlayer ), Float:fTime = get_gametime( );
if( g_iVoteMenu > 0 )
{
PrintColor( iClient, "There is already an ongoing vote." );
}
else if( g_fCoolDown[ iClient ] > fTime )
{
PrintColor( iClient, "You started a mute vote recently, try again in %.1f seconds.", g_fCoolDown[ iClient ] - fTime );
}
else if( !get_pcvar_num( g_pAllTalk ) && cs_get_user_team( iClient ) != cs_get_user_team( iPlayer ) )
{
PrintColor( iClient, "This player isn't in your team (alltalk isn't enabled)." );
}
else if( IsMuted( iPlayer ) )
{
PrintColor( iClient, "This player is already muted." );
}
else if( get_pcvar_num( g_pAdminImmunity ) && get_user_flags( iPlayer ) & ADMIN_FLAG )
{
PrintColor( iClient, "You can't start a vote against admins." );
}
else
{
ShowVoteMenu( iPlayer );
set_task( 12.0, "TaskEndVote", iPlayer );
g_fCoolDown[ iClient ] = fTime + get_pcvar_float( g_pCoolDown );
menu_destroy( iMenu );
return PLUGIN_HANDLED;
}
menu_destroy( iMenu );
ShowPlayerMenu( iClient );
return PLUGIN_HANDLED;
}
ShowVoteMenu( iTarget )
{
new szName[ 33 ], szMenu[ 40 ];
get_user_name( iTarget, szName, 32 );
formatex( szMenu, 39, "Mute %s?", szName );
g_iVoteMenu = menu_create( szMenu, "HandleVoteMenu" );
menu_additem( g_iVoteMenu, "Yes", "1" );
menu_additem( g_iVoteMenu, "No", "2" );
menu_setprop( g_iVoteMenu, MPROP_EXIT, MEXIT_NEVER );
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( !is_user_connected( i ) || i == iTarget || !get_pcvar_num( g_pAllTalk ) && cs_get_user_team( i ) != cs_get_user_team( iTarget ) )
{
continue;
}
menu_display( i, g_iVoteMenu );
}
}
public HandleVoteMenu( iClient, iMenu, iItem )
{
if( iItem == MENU_EXIT || !g_iVoteMenu )
{
return PLUGIN_HANDLED;
}
new _dummy, szChoice[ 2 ];
menu_item_getinfo( iMenu, iItem, _dummy, szChoice, 1, "", 0, _dummy );
g_iVotes[ str_to_num( szChoice ) - 1 ]++;
return PLUGIN_HANDLED;
}
public TaskEndVote( iTarget )
{
PrintColor( 0, "The vote has ended. Yes: %i - No: %i", g_iVotes[ VOTE_YES ], g_iVotes[ VOTE_NO ] );
new szName[ 33 ];
get_user_name( iTarget, szName, 32 );
if( g_iVotes[ VOTE_YES ] < g_iVotes[ VOTE_NO ] || !g_iVotes[ VOTE_YES ] && !g_iVotes[ VOTE_NO ] )
{
PrintColor( 0, "%s was not muted.", szName );
}
else
{
PrintColor( 0, "%s was muted.", szName );
TrieSetCell( g_tSteamIDs, g_szSteamId[ iTarget ], g_iMutedPlayers++ );
set_speak( iTarget, SPEAK_MUTED );
set_task( get_pcvar_float( g_pDuration ), "TaskUnmute", iTarget + TASK_UNMUTE,
g_szSteamId[ iTarget ], 34 );
}
menu_destroy( g_iVoteMenu );
g_iVotes[ VOTE_YES ] = 0;
g_iVotes[ VOTE_NO ] = 0;
g_iVoteMenu = 0;
}
public TaskUnmute( szAuthId[ ] )
{
TrieDeleteKey( g_tSteamIDs, szAuthId );
g_iMutedPlayers--;
new iClient = find_player( "c", szAuthId );
if( iClient > 0 )
{
new szName[ 33 ];
get_user_name( iClient, szName, 32 );
PrintColor( 0, "%s is no longer muted.", szName );
}
}
PrintColor( iClient, szText[], any:... )
{
new szMsg[ 191 ];
formatex( szMsg, 190, "^x04-|^x01 " );
vformat( szMsg[ 5 ], 185, szText, 3 );
message_begin( iClient ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgSayText, _, iClient );
write_byte( 1 );
write_string( szMsg );
message_end();
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1044\\ f0\\ fs16 \n\\ par }
*/
Creditos : Jon
Nao Traduzi o Plugin (Ele esta em ingles)
____________________________
Ajudei? Só clicar nesse sinalzinho aqui que vo ficar contente