Raised This Month: $ Target: $400
 0% 

[Check] Jailbreak Voice


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-09-2015 , 04:05   [Check] Jailbreak Voice
Reply With Quote #1

I think that this Code, crashes my server

I want to know if this code is fine, I did test and sometimes DEAD T Team can speak.

Code:
#pragma semicolon 1

#define OVER_8000 8001

new gI_MaxClients;

new gH_LRCanSpeak;

public plugin_init()
{
    gI_MaxClients = get_maxplayers();
    
    gH_LRCanSpeak = register_cvar("amx_jailbreak_lr_can_speak", "1", 0, 1.0);
    
    register_forward(FM_Voice_SetClientListening, "OnClientSpeak");
}
Code:
public OnClientSpeak(receiver, sender, bool:listen)
{
    if(!IsValidClient(receiver) || !IsValidClient(sender))
    {
        return FMRES_IGNORED;
    }
    
    if(get_user_flags(sender) & ADMIN_LEVEL_F)
    {
        return FMRES_IGNORED;
    }
    
    if(cs_get_user_team(sender) == CS_TEAM_CT && is_user_alive(sender))
    {
        return FMRES_IGNORED;
    }
    
    if(get_pcvar_num(gH_LRCanSpeak) && is_user_alive(sender) && cs_get_user_team(sender) == CS_TEAM_T)
    {
        static count;
        count = 0;
        
        static i;
        
        for(i = 1; i <= gI_MaxClients; i++)
        {
            if(IsValidClient(i, true) && cs_get_user_team(i) == CS_TEAM_T)
            {
                count++;
            }
        }
        
        if(count == 1)
        {
            return FMRES_IGNORED;
        }
    }
    
    engfunc(EngFunc_SetClientListening, receiver, sender, false);
    
    return FMRES_SUPERCEDE;
}

stock bool:IsValidClient(client, bool:bAlive = false)
{
    if(client >= 1 && client <= gI_MaxClients && is_user_connected(client) && (bAlive == false || is_user_alive(client)))
    {
        return true;
    }
    
    return false;
}

Last edited by Fuck For Fun; 01-09-2015 at 04:06.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
 



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 15:29.


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