Skip to content

Instantly share code, notes, and snippets.

@Hexer10
Created September 27, 2017 13:21
Show Gist options
  • Save Hexer10/61c2344d2a07ffe9a76b944a54bdfaf8 to your computer and use it in GitHub Desktop.
Save Hexer10/61c2344d2a07ffe9a76b944a54bdfaf8 to your computer and use it in GitHub Desktop.
ArrayList LrArray;
ArrayList LrArray2;
public void OnPluginStart()
{
LrArray = new ArrayList(32);
AddCommandListener(OnSay, "say");
AddCommandListener(OnSay, "say_team");
AddCommandListener(OnCmd);
LrArray.PushString("sm_lastrequest");
LrArray.PushString("sm_lr");
}
public Action OnSay(int client, const char[] command, int args)
{
//Get the say args
char sCmd[32];
GetCmdArgString(sCmd, sizeof(sCmd));
ReplaceString(sCmd, sizeof(sCmd), "\"", ""); //Remove quotes from start and end
Format(sCmd, sizeof(sCmd), "sm_%s", sCmd[1]); //Start from the 2 array to remove the ChatTrigger
if (LrArray.FindString(sCmd) != -1)
return Plugin_Stop;
return Plugin_Continue;
}
public Action OnCmd(int client, const char[] command, int args)
{
if (LrArray.FindString(command) != -1)
return Plugin_Stop;
return Plugin_Continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment