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