So I'm having this issue. I want to gag the player I type in as the first argument and the second argument should be stored in the "reason" variable so I can use that as reason on the gag.
But when I type "!tgag trum test" then the reason is "trum test". How can I seperate the first argument from the second?
PHP Code:
#include <sourcemod>
#include <sourcecomms>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "Trusted",
author = "",
description = "",
version = "",
url = ""
};
public void OnPluginStart()
{
RegAdminCmd("sm_tgag", Command_tGag, ADMFLAG_CUSTOM6, "Trusted gag command");
}
public Action Command_tGag(int client, int args)
{
char name[64];
GetCmdArgString(name, sizeof(name));
char reason[64];
GetCmdArgString(reason, sizeof(reason));
if (args < 2)
{
ReplyToCommand(client, " \x0C[TURF]⠀\x08Usage: sm_tgag <name> <reason>");
return Plugin_Handled;
}
SourceComms_SetClientGag(client, true, 30, true, reason);
return Plugin_Handled;
}
Thanks in advanced!