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

Solved How to hide the AMX Console command from "say"?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 02-13-2020 , 16:25   How to hide the AMX Console command from "say"?
Reply With Quote #1

Solved with ExecuteHamB(Ham_CS_RoundRespawn, id);

Hello.
I am using server_cmd and client_cmd functions in a plugin. These functions operate amx_revive. But I want it not to appear in "say chat". How can I do it?
I tried as follows, it still shows.

Code:
set_cvar_num("amx_show_activity",0);
server_cmd("amx_revive %s", gamer);
client_cmd(id, "amx_revive %s", gamer);
set_cvar_num("amx_show_activity",2);
I searched the forum a lot and couldn't find it.

Last edited by msbeden; 02-17-2020 at 16:16. Reason: SOLVED
msbeden is offline
Foxa
Member
Join Date: Nov 2018
Location: Croatia
Old 02-13-2020 , 16:36   Re: How to hide the AMX Console command from "say"?
Reply With Quote #2

What "revive" plugin are you using?
Foxa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-13-2020 , 22:18   Re: How to hide the AMX Console command from "say"?
Reply With Quote #3

If the chat message is being sent by the revive plugin, you need to update the revive plugin to behave in the way that you want.

Also, FYI, this is a perfect case to use amxclient_cmd(). This emulates a client command without needing to send it all the way to the player (and can't be blocked by the player) and triggers the associated plugin function.
__________________
fysiks is offline
thEsp
BANNED
Join Date: Aug 2017
Old 02-14-2020 , 12:27   Re: How to hide the AMX Console command from "say"?
Reply With Quote #4

I believe the OP is asking for return PLUGIN_HANDLED?
thEsp is offline
Foxa
Member
Join Date: Nov 2018
Location: Croatia
Old 02-16-2020 , 12:15   Re: How to hide the AMX Console command from "say"?
Reply With Quote #5

As I understood him he already has a "revive" plugin and for some reason he wants to make another plugin that will let anyone (no matter the flag that a player has) execute a revive on themselves (which is stupid, why not just modify the original revive plugin??) and when the command is executed he wants to block the message that pops up (e.g "Foxa has revived Foxa")

Just modify the plugin you're already using: register it as a "say command", don't check for flags, remove the message.

Or just use this if I'm right..

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#pragma semicolon true

#define PLUGIN "My"
#define VERSION "Name"
#define AUTHOR "Jeff"


public plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say /revive""clcmd_Revive");
}

public 
clcmd_Revive(id){
    if(
is_user_alive(id))
        return 
PLUGIN_HANDLED;
        
    
ExecuteHamB(Ham_CS_RoundRespawnid);
    return 
PLUGIN_HANDLED;


Last edited by Foxa; 02-16-2020 at 12:22.
Foxa is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-17-2020 , 04:57   Re: How to hide the AMX Console command from "say"?
Reply With Quote #6

Not sure, but wouldn't be something like this better? I mean it's not optimal, since the original code should be adjusted instead of creating a new one.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "BlockReviveMsg"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say""HandleSay");
}

public 
HandleSay(id)
{
    new 
szArg[10];
    
read_argv(1szArgcharsmax(szArg));
    
    if(
equal(szArg"/revive"))
    {
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;

__________________

Last edited by Napoleon_be; 02-17-2020 at 04:59.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-17-2020 , 23:30   Re: How to hide the AMX Console command from "say"?
Reply With Quote #7

The OP is sending a chat command to the user at all so neither of your plugins will work. I don't think that returning PLUGIN_HANDLED in any context will solve the issue. It looks more likely that the plugin is actually doing client_print() or something equivalent and the editing in this case must be in the revive plugin.

Let's wait for the OP to respond with some feedback so we don't keep speculating endlessly.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 11:31.


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