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

[REQ] [CS:GO] Radio command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rav1sh
Junior Member
Join Date: Apr 2020
Old 04-18-2020 , 16:55   [REQ] [CS:GO] Radio command
Reply With Quote #1

Is it possible to block Radio commands in chat and sound for everyone except a certain admin flag. The only thing that I found was this:

PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define ACCESS_ADMIN ADMIN_LEVEL_A
 
new bool:rblocked;
new 
rmenus[3][32] = { "radio1""radio2""radio3" }
 
new 
radioblock;
 
public 
plugin_init() {
 
 
register_plugin("""""");
 
radioblock register_cvar("amx_blockradio","1");
 for(new 
03i++) register_clcmd(rmenus[i], "check_rblock");
}
 
public 
blockradio(idlevelcid) {
 if(!
cmd_access(idlevelcid1))
  return 
PLUGIN_HANDLED;
 
 if(
get_pcvar_num(radioblock) ==1) {
  
rblocked rblocked false true
  console_print
(id"[AMXX] The usage of radios is now %sallowed"rblocked "dis" "")
 }
 return 
PLUGIN_HANDLED;
}
 
public 
check_rblock(id) {
 if(
rblocked
  return 
PLUGIN_HANDLED;
 
 return 
PLUGIN_CONTINUE;

Rav1sh is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 04-18-2020 , 17:06   Re: [REQ] [CS:GO] Radio command
Reply With Quote #2

That's for AMX, this is Sourcemod.
__________________
NanoC is offline
Send a message via Skype™ to NanoC
Rav1sh
Junior Member
Join Date: Apr 2020
Old 04-18-2020 , 17:10   Re: [REQ] [CS:GO] Radio command
Reply With Quote #3

Is there a plugin for sourcemod that let's general users not use the radio commands and only a specific admin flag
Rav1sh is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 04-18-2020 , 18:11   Re: [REQ] [CS:GO] Radio command
Reply With Quote #4

Quote:
Originally Posted by Rav1sh View Post
Is there a plugin for sourcemod that let's general users not use the radio commands and only a specific admin flag
Well, i modified the old syntax to the new one from shavit's block radio plugin, and i have added a line to block players to use the radio if they don't have a certain flag

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "2.0.3"

ConVar gH_Enabled;
ConVar gH_Message;
ConVar gH_Nade;
ConVar gH_Ignorenade;

bool gB_Enabled;
bool gB_Message;
bool gB_Nade;

char RadioCMDS[][] = {"coverme""takepoint""holdpos""regroup""followme""takingfire""go""fallback""sticktog",
    
"getinpos""stormfront""report""roger""enemyspot""needbackup""sectorclear""inposition""reportingin",
    
"getout""negative","enemydown""compliment""thanks""cheer"};

public 
Plugin myinfo 
{
    
name "[CS:S] Block Radio",
    
author "TimeBomb",
    
description "Blocks all of the radio commucations.",
    
version PLUGIN_VERSION,
    
url "http://hl2.co.il/"
}

public 
void OnPluginStart()
{    
    
LoadTranslations("blockradio.phrases");
    
    if(
GetEngineVersion() != Engine_CSS && GetEngineVersion() != Engine_CSGO)
    {
        
SetFailState("[Block Radio] Failed to load because the only game supported is CS:S/CS:GO.");
    }
    
    for(
int isizeof(RadioCMDS); i++)
    {
        
AddCommandListener(BlockRadioRadioCMDS[i]);
    }
    
    
// Console Variables
    
gH_Enabled CreateConVar("sm_blockradio_enabled""1""Is \"Block Radio\" enabled?");
    
gB_Enabled true;
    
gH_Enabled.AddChangeHook(OnConVarChanged);
    
    
gH_Message CreateConVar("sm_blockradio_message""1""Is notifying about blocked radio messages enabled?");
    
gB_Message true;
    
gH_Message.AddChangeHook(OnConVarChanged);
    
    
gH_Nade CreateConVar("sm_blockradio_grenade""1""Is \"Fire in the hole\" radio sound is supressed?");
    
gB_Nade true;
    
gH_Nade.AddChangeHook(OnConVarChanged);
    
    
gH_Ignorenade FindConVar("sv_ignoregrenaderadio");
    
SetConVarInt(gH_Ignorenade1);
    
    
Handle Version CreateConVar("sm_blockradio_version"PLUGIN_VERSION"\"Block Radio\" plugin version");
    
SetConVarString(VersionPLUGIN_VERSION_true);
    
    
AutoExecConfig();
}

public 
void OnConVarChanged(ConVar convar, const char[] oldValue, const char [] newValue)
{
    if(
convar == gH_Nade)
    {
        
gB_Nade StringToInt(newValue)? true:false;
        
SetConVarInt(gH_IgnorenadegB_Nade1:0);
    }
    
    else if(
convar == gH_Message)
    {
        
gB_Message StringToInt(newValue)? true:false;
    }
    
    else if(
convar == gH_Enabled)
    {
        
gB_Enabled StringToInt(newValue)? true:false;
    }
}

public 
Action BlockRadio(int client, const char[] commandint args
{
    if(
gB_Enabled)
    {
        if(
gB_Message)
        {
            if(
IsClientInGame(client) && !GetUserAdmin(client).HasFlag(Admin_Generic))
            {
                
PrintToChat(client"\x04[SM]\x01 %t""Blocked");
            }
        }
        
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

Edit line 91 and add the flag you want to use, then compile it (you will need translations file that can be found in the shavit's plugin thread)
__________________
NanoC is offline
Send a message via Skype™ to NanoC
Rav1sh
Junior Member
Join Date: Apr 2020
Old 04-19-2020 , 08:21   Re: [REQ] [CS:GO] Radio command
Reply With Quote #5

Quote:
Originally Posted by NanoC View Post
Well, i modified the old syntax to the new one from shavit's block radio plugin, and i have added a line to block players to use the radio if they don't have a certain flag

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "2.0.3"

ConVar gH_Enabled;
ConVar gH_Message;
ConVar gH_Nade;
ConVar gH_Ignorenade;

bool gB_Enabled;
bool gB_Message;
bool gB_Nade;

char RadioCMDS[][] = {"coverme""takepoint""holdpos""regroup""followme""takingfire""go""fallback""sticktog",
    
"getinpos""stormfront""report""roger""enemyspot""needbackup""sectorclear""inposition""reportingin",
    
"getout""negative","enemydown""compliment""thanks""cheer"};

public 
Plugin myinfo 
{
    
name "[CS:S] Block Radio",
    
author "TimeBomb",
    
description "Blocks all of the radio commucations.",
    
version PLUGIN_VERSION,
    
url "http://hl2.co.il/"
}

public 
void OnPluginStart()
{    
    
LoadTranslations("blockradio.phrases");
    
    if(
GetEngineVersion() != Engine_CSS && GetEngineVersion() != Engine_CSGO)
    {
        
SetFailState("[Block Radio] Failed to load because the only game supported is CS:S/CS:GO.");
    }
    
    for(
int isizeof(RadioCMDS); i++)
    {
        
AddCommandListener(BlockRadioRadioCMDS[i]);
    }
    
    
// Console Variables
    
gH_Enabled CreateConVar("sm_blockradio_enabled""1""Is \"Block Radio\" enabled?");
    
gB_Enabled true;
    
gH_Enabled.AddChangeHook(OnConVarChanged);
    
    
gH_Message CreateConVar("sm_blockradio_message""1""Is notifying about blocked radio messages enabled?");
    
gB_Message true;
    
gH_Message.AddChangeHook(OnConVarChanged);
    
    
gH_Nade CreateConVar("sm_blockradio_grenade""1""Is \"Fire in the hole\" radio sound is supressed?");
    
gB_Nade true;
    
gH_Nade.AddChangeHook(OnConVarChanged);
    
    
gH_Ignorenade FindConVar("sv_ignoregrenaderadio");
    
SetConVarInt(gH_Ignorenade1);
    
    
Handle Version CreateConVar("sm_blockradio_version"PLUGIN_VERSION"\"Block Radio\" plugin version");
    
SetConVarString(VersionPLUGIN_VERSION_true);
    
    
AutoExecConfig();
}

public 
void OnConVarChanged(ConVar convar, const char[] oldValue, const char [] newValue)
{
    if(
convar == gH_Nade)
    {
        
gB_Nade StringToInt(newValue)? true:false;
        
SetConVarInt(gH_IgnorenadegB_Nade1:0);
    }
    
    else if(
convar == gH_Message)
    {
        
gB_Message StringToInt(newValue)? true:false;
    }
    
    else if(
convar == gH_Enabled)
    {
        
gB_Enabled StringToInt(newValue)? true:false;
    }
}

public 
Action BlockRadio(int client, const char[] commandint args
{
    if(
gB_Enabled)
    {
        if(
gB_Message)
        {
            if(
IsClientInGame(client) && !GetUserAdmin(client).HasFlag(Admin_Generic))
            {
                
PrintToChat(client"\x04[SM]\x01 %t""Blocked");
            }
        }
        
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

Edit line 91 and add the flag you want to use, then compile it (you will need translations file that can be found in the shavit's plugin thread)
Thanks for the plugin! I've only had 1 issue with it. I've put line 91 to:
HTML Code:
if(IsClientInGame(client) && !GetUserAdmin(client).HasFlag(Admin_Custom1))
But for some reason they don't have access to it either.
Rav1sh is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-19-2020 , 09:35   Re: [REQ] [CS:GO] Radio command
Reply With Quote #6

Here, I updated. Cs:s cs:go

https://forums.alliedmods.net/showpo...61&postcount=2

*edit
flags can override with "sm_allow_radio", not need re-compile plugin anymore.


example
__________________
Do not Private Message @me

Last edited by Bacardi; 04-19-2020 at 09:41.
Bacardi is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 04-19-2020 , 12:25   Re: [REQ] [CS:GO] Radio command
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
Here, I updated. Cs:s cs:go

https://forums.alliedmods.net/showpo...61&postcount=2

*edit
flags can override with "sm_allow_radio", not need re-compile plugin anymore.


example
Amazing🥇
__________________
NanoC is offline
Send a message via Skype™ to NanoC
Rav1sh
Junior Member
Join Date: Apr 2020
Old 04-19-2020 , 12:30   Re: [REQ] [CS:GO] Radio command
Reply With Quote #8

Quote:
Originally Posted by Bacardi View Post
Here, I updated. Cs:s cs:go

https://forums.alliedmods.net/showpo...61&postcount=2

*edit
flags can override with "sm_allow_radio", not need re-compile plugin anymore.


example
Thanksss! Plugin works perfectly!
May I ask one more thing. Is it possible to remove these purple dots in chat wihtout changing the gamemode or turning off the colors (so it still works on the map but not in chat).
https://imgur.com/Uolip3n
Rav1sh is offline
Teamkiller324
Senior Member
Join Date: Feb 2014
Location: Earth
Old 07-02-2020 , 15:57   Re: [REQ] [CS:GO] Radio command
Reply With Quote #9

Quote:
Originally Posted by Rav1sh View Post
Thanksss! Plugin works perfectly!
May I ask one more thing. Is it possible to remove these purple dots in chat wihtout changing the gamemode or turning off the colors (so it still works on the map but not in chat).
https://imgur.com/Uolip3n
It's either a bug within csgo itself or just a issue with the chat processor itself.
__________________
Teamkiller324 is offline
Teamkiller324
Senior Member
Join Date: Feb 2014
Location: Earth
Old 07-06-2020 , 07:43   Re: [REQ] [CS:GO] Radio command
Reply With Quote #10

Quote:
Originally Posted by Rav1sh View Post
Thanks for the plugin! I've only had 1 issue with it. I've put line 91 to:
HTML Code:
if(IsClientInGame(client) && !GetUserAdmin(client).HasFlag(Admin_Custom1))
But for some reason they don't have access to it either.
Try using || instead of &&, could fix it.
__________________
Teamkiller324 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:33.


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