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

Solved Command changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WhiteAngel4
Junior Member
Join Date: Jan 2014
Old 07-29-2022 , 12:01   Command changer
Reply With Quote #1

Hi!

I would like to ask a little help.

Code:
RegConsoleCmd("sm_CONSOLEcommand", Command_Something, "Do something!");
Code:
else if (strcmp(info, "CHATcommand") == 0)
		{
			FakeClientCommand(client, "sm_CONSOLEcommand");
		}
I'd like to add more command next to the "CHATcommand" without editing the original plugin for example "CHATcommand2"
It would be one more plugin, but I need this way.

Last edited by WhiteAngel4; 08-04-2022 at 05:52.
WhiteAngel4 is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 07-29-2022 , 14:40   Re: Command changer
Reply With Quote #2

Your thread should in the scripting section. Can you elaborate on what you are trying to achieve further?

Maybe you are trying to do the following? I have a command on my server "sm_smote" but I don't have the sourcecode for it to add print messages. So I created another "sm_smote" command in a new plugin to add the print messages.

PHP Code:
#include <sourcemod>
#pragma semicolon 1

public void OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
RegAdminCmd("sm_smote"Command_SmotehookADMFLAG_GENERIC"");
}

public 
Action Command_Smotehook(int clientint args)
{    
        
char arg1[64];
        
GetCmdArgString(arg1sizeof(arg1));
        
        
char target_name[MAX_TARGET_LENGTH];
        
int target_list[MAXPLAYERS], target_count;
        
bool tn_is_ml;

        if ((
target_count ProcessTargetString(arg1clienttarget_listMAXPLAYERSCOMMAND_FILTER_CONNECTEDtarget_namesizeof(target_name), tn_is_ml)) <= 0)
        {
            
ReplyToTargetError(clienttarget_count);
            return 
Plugin_Handled;
        }
        
PrintToChatAll("\x01\x07FFA07A%N smote %s"clienttarget_name);
        return 
Plugin_Handled;


Last edited by Sreaper; 07-29-2022 at 14:42.
Sreaper 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 16:47.


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