Raised This Month: $ Target: $400
 0% 

Need help with code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 07-09-2013 , 14:39   Need help with code
Reply With Quote #1

Hello i found a code here on AM so cts can type /voice to enable/disable terrorists voice only my admins can use that command on ct team i need to know so they can also enable it on T Side heres the code

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>

new terrorist_voice 0;

public 
plugin_init()
{
    
register_plugin("Disable Voice For Terrorist""1.0""GPOWER")
    
    
register_forward(FM_Voice_SetClientListening"Voice_Listen"0); 
    
    
register_concmd ("amx_terovoice""voice_tero"ADMIN_BAN"- Turns ON or OFF voice for Terrorist" );
    
register_clcmd("say /voice""change_voice")
}
public 
change_voice(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT && !( get_user_flags(id) & ADMIN_BAN ) )
   {
        switch(
terrorist_voice)
        {
            case 
0:
            {
                
terrorist_voice 1;
            }
            case 
1:
            {
                
terrorist_voice 0;
            }
        }
    }
}
public 
voice_tero id ) {
    new 
arg[2];
    
read_argv 1arg);
    
    if ( 
equal arg"1" ) ) 
    {
        
terrorist_voice 1;
    } 
    else if ( 
equal arg"0" ) ) 
    {
        
terrorist_voice 0
    

    else 
    {
        if ( 
terrorist_voice == ){
            
console_print id"Usage: amx_terovoice 1 = 0n 0 = off Currently: 0" );
        }
        if ( 
terrorist_voice == ){
            
console_print id"Usage: amx_terovoice 1 = 0n 0 = off Currently: 1" );
        }
    }
    
    return 
PLUGIN_CONTINUE;
}
public 
Voice_Listen(iReceiveriSender)
{
    if(!
is_user_connected(iReceiver) || !is_user_connected(iSender) || iReceiver == iSender)
        return 
FMRES_IGNORED
        
    if(
terrorist_voice == 0)
    {
        if(
cs_get_user_team(iSender) == CS_TEAM_T || !is_user_alive(iSender))
        {
            
engfunc(EngFunc_SetClientListeningiReceiveriSender0);
            return 
FMRES_SUPERCEDE;
        }
    }
    else if(
terrorist_voice == 1)
    {
        if(!
is_user_alive(iSender))
        {
            
engfunc(EngFunc_SetClientListeningiReceiveriSender0);
            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;

asdfdsdf is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode