Raised This Month: $ Target: $400
 0% 

Voice plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Martix
Member
Join Date: Jul 2010
Old 10-07-2010 , 08:47   Voice plugin
Reply With Quote #1

Hello, could you say me what to change if i want only admins with ADMIN_CHAT to be able to talk? (now admins with ADMIN_CHAT AND CT's can)

Code:
// Voice Manager by Exolent

// This plugin will gag all terrorists and dead cts.
// Admins with menu access are not affected by this.


#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>


#define ADMIN_VOICE ADMIN_CHAT


new bool:g_connected[33];
new g_max_clients;


public plugin_init() {
    register_plugin("Voice Manager", "0.1", "Exolent");
    register_forward(FM_Voice_SetClientListening, "FwdSetVoice");
    g_max_clients = get_maxplayers();
}

public client_putinserver(client) {
    g_connected[client] = true;
}

public client_disconnect(client) {
    g_connected[client] = false;
}

public FwdSetVoice(receiver, sender, bool:listen) {
    if( !(1 <= receiver <= g_max_clients)
    || !g_connected[receiver]
    || !(1 <= sender <= g_max_clients)
    || !g_connected[sender] ) return FMRES_IGNORED;

    new CsTeams:team = cs_get_user_team(sender);
    if( (team == CS_TEAM_T || team == CS_TEAM_CT && !is_user_alive(sender)) && !access(sender, ADMIN_VOICE) ) {
        engfunc(EngFunc_SetClientListening, receiver, sender, 0);
        return FMRES_SUPERCEDE;
    }

    return FMRES_IGNORED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Martix 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 10:20.


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