Skip to content

Instantly share code, notes, and snippets.

@nosoop
Last active November 24, 2016 10:14
Show Gist options
  • Save nosoop/5bfab038e651fa35b7e1b12a7a9c47fc to your computer and use it in GitHub Desktop.
Save nosoop/5bfab038e651fa35b7e1b12a7a9c47fc to your computer and use it in GitHub Desktop.
Hooks the spray command, disabling its use.
/**
* Disables the spray command.
*/
#pragma semicolon 1
#include <sourcemod>
#include <sdktools_hooks>
#pragma newdecls required
#define PLUGIN_VERSION "0.0.0"
public Plugin myinfo = {
name = "Spray Disabler",
author = "nosoop",
description = "Prevents usage of the spray command.",
version = PLUGIN_VERSION,
url = "https://redd.it/5embg0"
}
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse) {
if (impulse == 201) {
impulse = 0;
return Plugin_Changed;
}
return Plugin_Continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment