AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved How to hide the AMX Console command from "say"? (https://forums.alliedmods.net/showthread.php?t=321494)

msbeden 02-13-2020 16:25

How to hide the AMX Console command from "say"?
 
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.

Foxa 02-13-2020 16:36

Re: How to hide the AMX Console command from "say"?
 
What "revive" plugin are you using?

fysiks 02-13-2020 22:18

Re: How to hide the AMX Console command from "say"?
 
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.

thEsp 02-14-2020 12:27

Re: How to hide the AMX Console command from "say"?
 
I believe the OP is asking for return PLUGIN_HANDLED?

Foxa 02-16-2020 12:15

Re: How to hide the AMX Console command from "say"?
 
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;



Napoleon_be 02-17-2020 04:57

Re: How to hide the AMX Console command from "say"?
 
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;



fysiks 02-17-2020 23:30

Re: How to hide the AMX Console command from "say"?
 
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.


All times are GMT -4. The time now is 01:50.

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