Raised This Month: $32 Target: $400
 8% 

SourceComms


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 06-19-2018 , 02:21   SourceComms
Reply With Quote #1

Hello, does anybody know how can I edit SourceComms in such a way to apply gag, mute and silence on just a command?

That is, if I apply only gag (sm_gag name 15) to apply automatically and mute and slience.

Code:
public Action:CommandCallback(client, const String:command[], args)
{
    if (client && !CheckCommandAccess(client, command, ADMFLAG_CHAT))
        return Plugin_Continue;

    new type;
    if (StrEqual(command, "sm_gag", false))
        type = TYPE_GAG, TYPE_MUTE, TYPE_SILENCE;
    else if (StrEqual(command, "sm_mute", false))
        type = TYPE_GAG, TYPE_MUTE, TYPE_SILENCE;
    else if (StrEqual(command, "sm_ungag", false))
        type = TYPE_UNGAG, TYPE_UNSILENCE, TYPE_UNMUTE;
    else if (StrEqual(command, "sm_unmute", false))
        type = TYPE_UNGAG, TYPE_UNSILENCE, TYPE_UNMUTE;
    else if (StrEqual(command, "sm_silence", false))
        type = TYPE_GAG, TYPE_MUTE, TYPE_SILENCE;
    else if (StrEqual(command, "sm_unsilence", false))
        type = TYPE_UNGAG, TYPE_UNSILENCE, TYPE_UNMUTE;
    else
        return Plugin_Stop;

    if (args < 1)
    {
        ReplyToCommand(client, "%sUsage: %s <#userid|name> %s", PREFIX, command, type <= TYPE_SILENCE ? "[time|0] [reason]" : "[reason]");
        if (type <= TYPE_SILENCE)
            ReplyToCommand(client, "%sUsage: %s <#userid|name> [reason]", PREFIX, command);
        return Plugin_Stop;
    }

    new String:sBuffer[256];
    GetCmdArgString(sBuffer, sizeof(sBuffer));

    if (type <= TYPE_SILENCE)
        CreateBlock(client, _, _, type, _, sBuffer);
    else
        ProcessUnBlock(client, _, type, _, sBuffer);

    return Plugin_Stop;
}
that's what I tried
kratoss1812 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-19-2018 , 04:27   Re: SourceComms
Reply With Quote #2

PHP Code:
#include <sdktools>

public void OnPluginStart()
{
    
RegAdminCmd("sm_gag"Cmd_GagADMFLAG_CHAT);
}

public 
Action Cmd_Gag(int iClientint iArgs)
{
    
char sArg[MAX_NAME_LENGTH];
    
    
GetCmdArg(1sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);
    
    
GetClientUserId(iTarget);
    
    
SetClientListeningFlags(iTargetGetClientListeningFlags(iTarget) &~ 0);

Something like this should work, just try to put it in there.
mug1wara is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 06-19-2018 , 06:44   Re: SourceComms
Reply With Quote #3

Quote:
Originally Posted by mug1wara View Post
PHP Code:
#include <sdktools>

public void OnPluginStart()
{
    
RegAdminCmd("sm_gag"Cmd_GagADMFLAG_CHAT);
}

public 
Action Cmd_Gag(int iClientint iArgs)
{
    
char sArg[MAX_NAME_LENGTH];
    
    
GetCmdArg(1sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);
    
    
GetClientUserId(iTarget);
    
    
SetClientListeningFlags(iTargetGetClientListeningFlags(iTarget) &~ 0);

Something like this should work, just try to put it in there.
thanks
kratoss1812 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 07:53.


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