Raised This Month: $ Target: $400
 0% 

Admin Listen Optimization


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
tcPane
Senior Member
Join Date: Sep 2010
Old 09-10-2012 , 05:06   Re: Admin Listen Optimization
Reply With Quote #10

Quote:
Originally Posted by YamiKaitou View Post
The only way you will become a better scripter is if you start to figure this out on your own. I gave you enough information to get started, now go figure it out and then come back with your modified script.
Check it:
PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <engine>  

#define PLUGIN "Admin Listen" 
#define VERSION "2.3x" 

new Count[32][32], g_Voice_Status[2]

public 
plugin_init() 
{  
    
register_plugin(PLUGINVERSION"/dev/ urandom")  
 
    
register_event("SayText""CatchSay""b")  
        
    
register_srvcmd("amx_voice""VoiceStatus"
    
    
cstrike is_running("cstrike")
}  

public 
CatchSay(id)  
{  
     new 
Reciever read_data(0)  
    new 
Sender   read_data(1)   
    new 
Message[151], Channel[151], SenderName[32]  

    if(
cstrike)  
     {  
          
read_data(2Channel150)  
         
read_data(4Message150)  
        
get_user_name(SenderSenderName31)  
    }  
    else  
    {  
        
read_data(2Message150)  
    }  
     
    
Count[Sender][Reciever] = 1            

    
if(Sender == Reciever)  
     {        
        new 
Player
        
new PlayerCount get_playersnum()   
        
get_players(PlayerPlayerCount"c")  
         
        for(new 
0PlayerCounti++)   
        {  
            
Player Players[i]
            if(
get_user_flags(Player) & ADMIN_IMMUNITY)  
             {       
                  if(
Count[Sender][Player] != 1)  
                    {                
                         
message_begin(MSG_ONEget_user_msgid("SayText"), { 00}, Player)  
                        
write_byte(Sender)   
                     
                        if(
cstrike)  
                        {  
                              
write_string(Channel)  
                             
write_string(SenderName)  
                        } 
                     
                            
write_string(Message)  
                         
message_end()  
                    }  
            } 
             
            
Count[Sender][Player] = 
        
}  
    }  
}  

public 
VoiceStatus() 
{  
    
read_argv(1g_Voice_Status1
    
    new 
Player  
    
new PlayerCount get_playersnum()  
    
get_players(PlayerPlayerCount"c")  
     
    for(new 
0PlayerCounti++)  
    {  
        
Player Players[i]
         if((
get_user_flags(Player) & ADMIN_IMMUNITY)) 
        {           
              if(
equal(g_Voice_Status[0])  
              { 
                   
set_speak(Player0)  
                } 
                else
                { 
                    
set_speak(Player4)  
                } 
            }  
        }  
}  

public 
client_infochanged(id)  
{  
    if((
get_user_flags(id) & ADMIN_IMMUNITY) && equal(g_Voice_Status"1")) set_speak(id4)  
}  

public 
client_connect(id)  
{  
      if((
get_user_flags(id) & ADMIN_IMMUNITY) && equal(g_Voice_Status"1")) set_speak(id4)  

tcPane 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 08:20.


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