AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Voice plugin (https://forums.alliedmods.net/showthread.php?t=139951)

Martix 10-07-2010 08:47

Voice plugin
 
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 }
*/



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

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