Raised This Month: $ Target: $400
 0% 

Mute code help please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Leetbix
Member
Join Date: Dec 2009
Old 12-07-2009 , 02:36   Mute code help please
Reply With Quote #1

Hello, I just wanted to know. Say if, i muted someone for 60 seconds. People just leave and come back in and they are unmuted. is there a script command that if they quit they stay muted for 60 seconds even when they try to rejoin into the game they are still muted.

Thanks
Leetbix is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 12-07-2009 , 03:07   Re: Mute code help please
Reply With Quote #2

no there isnt, but if this is in regard to your plugin that mutes an entire team, a simple solution would be to use a bool to determine if they should be muted or not when they connect. if the bool is true and they join the muted team, mute them.
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
Leetbix
Member
Join Date: Dec 2009
Old 12-07-2009 , 03:14   Re: Mute code help please
Reply With Quote #3

so the bool:dontBroadcast should be bool:true?

ublic Action:OnPlayerSpawn(Handle:event, const String:name[], bool:true) ?

Last edited by Leetbix; 12-07-2009 at 03:20.
Leetbix is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 12-07-2009 , 03:31   Re: Mute code help please
Reply With Quote #4

what? no. here.
PHP Code:
new bool:mute;

public 
OnPluginStart()
{
    
LogMessage("[SM] Leetbix | 1337 Mute Terrorist System Started");

    
HookEvent("round_start"EventRoundStart);
    
HookEvent("player_team"EventPlayerTeam);
}

public 
EventRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    
ServerCommand("sm_mute @t");
    
LogMessage("[SM] Terrorists Muted For 60 Seconds");
    
CreateTimer(60.0Unmuted_Terrorists);
    
mute true;
}

public 
Action:Unmuted_Terrorists(Handle:timer)
{
    
ServerCommand("sm_unmute @t");
    
LogMessage("[SM] Terrorists Have Been Unmuted");
    
mute false;
}

public 
EventPlayerTeam(Handle:event,const String:name[],bool:dontBroadcast)
{
    if (
mute == true// should players be muted?
    
{
        new 
client GetEventInt(event"userid");
        new 
team GetEventInt(event"team");
        if (
team == 2// 2 = t, 3 = ct
        
{
            
ServerCommand("sm_mute #%i"client);
        }
    }

in the end you may need to keep an array of the players that are muted for proper functionality.
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
Leetbix
Member
Join Date: Dec 2009
Old 12-07-2009 , 03:38   Re: Mute code help please
Reply With Quote #5

Wow thanks alot, Meng you helped me alot =]

Last edited by Leetbix; 12-07-2009 at 03:47.
Leetbix is offline
Leetbix
Member
Join Date: Dec 2009
Old 12-10-2009 , 18:47   Re: Mute code help please
Reply With Quote #6

Quote:
Originally Posted by meng View Post
what? no. here.
PHP Code:
new bool:mute;

public 
OnPluginStart()
{
    
LogMessage("[SM] Leetbix | 1337 Mute Terrorist System Started");

    
HookEvent("round_start"EventRoundStart);
    
HookEvent("player_team"EventPlayerTeam);
}

public 
EventRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    
ServerCommand("sm_mute @t");
    
LogMessage("[SM] Terrorists Muted For 60 Seconds");
    
CreateTimer(60.0Unmuted_Terrorists);
    
mute true;
}

public 
Action:Unmuted_Terrorists(Handle:timer)
{
    
ServerCommand("sm_unmute @t");
    
LogMessage("[SM] Terrorists Have Been Unmuted");
    
mute false;
}

public 
EventPlayerTeam(Handle:event,const String:name[],bool:dontBroadcast)
{
    if (
mute == true// should players be muted?
    
{
        new 
client GetEventInt(event"userid");
        new 
team GetEventInt(event"team");
        if (
team == 2// 2 = t, 3 = ct
        
{
            
ServerCommand("sm_mute #%i"client);
        }
    }

in the end you may need to keep an array of the players that are muted for proper functionality.
Meng when you join T during the mute=true it says You have been muted, but it doesn't actually mute him it just says it. How to fix? i tried changing it but no luck, also i wanted that private message to that client to be hidden.
Leetbix is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 12-10-2009 , 19:22   Re: Mute code help please
Reply With Quote #7

try this.
PHP Code:
public EventPlayerTeam(Handle:event,const String:name[],bool:dontBroadcast)
{
    if (
mute == true)
    {
        new 
client GetClientOfUserId(GetEventInt(event,"userid"));
        new 
team GetEventInt(event"team");
        if (
team == 2)
        {
            
SetClientListeningFlags(clientVOICE_MUTED);
        }
    }

__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
Leetbix
Member
Join Date: Dec 2009
Old 12-10-2009 , 19:53   Re: Mute code help please
Reply With Quote #8

Quote:
Originally Posted by meng View Post
try this.
PHP Code:
public EventPlayerTeam(Handle:event,const String:name[],bool:dontBroadcast)
{
    if (
mute == true)
    {
        new 
client GetClientOfUserId(GetEventInt(event,"userid"));
        new 
team GetEventInt(event"team");
        if (
team == 2)
        {
            
SetClientListeningFlags(clientVOICE_MUTED);
        }
    }

Super Last Question Meng.

How would you mute that quote there.
Like i dont want it saying in chat [SM] Admin Muted #%i(client), i just want it to say Terrorists have been Muted on EventRoundStart
Leetbix is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 12-10-2009 , 19:59   Re: Mute code help please
Reply With Quote #9

that code wont show any message.
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
Leetbix
Member
Join Date: Dec 2009
Old 12-10-2009 , 20:22   Re: Mute code help please
Reply With Quote #10

Error --- SetClientListeningFlags
Undefined Symbol????
Leetbix is offline
Reply



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 19:13.


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