Raised This Month: $12 Target: $400
 3% 

Disable radio messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-01-2008 , 09:00   Disable radio messages
Reply With Quote #1

Hi, I need a plugin/code to disable radio messages for a certain team.
Let's say I want CTs be able to use radio messages while Ts can't do that. It should disable radio messages menu and console commands. Thanks.

Last edited by hleV; 02-04-2008 at 13:17.
hleV is offline
Howdy!
Senior Member
Join Date: Feb 2007
Old 02-01-2008 , 09:24   Re: Disable radio radio messages
Reply With Quote #2

I think such plugin already exists. Have you tried to search?
__________________
[IMG]http://img221.**************/img221/5608/howdyfinnishhq2.jpg[/IMG]
Howdy! is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-01-2008 , 11:49   Re: Disable radio radio messages
Reply With Quote #3

cvar :

amx_radio_allow 0=allow all, 1=allow Ts, 2=allow CTs, > 2 Nobody allowed

PHP Code:
#include <amxmodx>

#define MAX_RADIO_CMDS 24

new const g_radio_commands[MAX_RADIO_CMDS][] = {
    
"radio1"
    
"coverme""takepoint""holdpos""regroup""followme""takingfire",
    
"radio2"
    
"go""fallback""sticktog""getinpos""stormfront""report",
    
"radio3"
    
"roger""enemyspot""needbackup""sectorclear""inposition""reportingin""getout""negative""enemydown"
}

new 
g_pcvarAllowRadio

public plugin_init()
{
    
register_plugin("Block Radio""0.1""ConnorMcLeod")

    
g_pcvarAllowRadio register_cvar("amx_radio_allow""0")

    for(new 
ii<MAX_RADIO_CMDSi++)
        
register_clcmd(g_radio_commands[i], "clcmdBlocked")
}

public 
clcmdBlocked(id)
{
    new 
iMode get_pcvar_num(g_pcvarAllowRadio)
    if(!
iMode || get_user_team(id) == iMode)
        return 
PLUGIN_CONTINUE
    
return PLUGIN_HANDLED_MAIN

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-01-2008 , 15:32   Re: Disable radio radio messages
Reply With Quote #4

connorr, you're code may work, but may i ask why you did the cvar that way?

i prefer to use it like a bitsum and 0 for no one, 1 for t, 2 for ct, or 3 for all.

just wondering :S

EDIT: or it would work my way if the cvar was such as amx_radio_block :\
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-01-2008 , 16:39   Re: Disable radio radio messages
Reply With Quote #5

Thanks connorr. You always help.
hleV 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 14:23.


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