Skip to content

Instantly share code, notes, and snippets.

@Rainyan
Last active October 14, 2024 22:39
Show Gist options
  • Select an option

  • Save Rainyan/184816ddbf569a628045b30ed6d339e4 to your computer and use it in GitHub Desktop.

Select an option

Save Rainyan/184816ddbf569a628045b30ed6d339e4 to your computer and use it in GitHub Desktop.
Experimental plugin for Neotokyo. Forces alltalk off when the ghost is picked up. Untested.
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
ConVar sv_alltalk;
bool alltalkWas;
public Plugin myinfo = {
name = "NT Disable Alltalk When Ghosting",
description = "Forces alltalk off when the ghost is picked up.",
author = "Rain",
version = "0.1.0",
url = "https://gist.github.com/Rainyan/184816ddbf569a628045b30ed6d339e4"
};
public void OnAllPluginsLoaded()
{
if (FindConVar("sm_ntghostcap_version") == null)
{
char url[] = "https://github.com/softashell/nt-sourcemod-plugins/blob/master/scripting/nt_ghostcap.sp";
SetFailState("This plugin requires the nt_ghostcap plugin:\n%s", url);
}
}
public void OnPluginStart()
{
sv_alltalk = FindConVar("sv_alltalk");
sv_alltalk.AddChangeHook(AlltalkChanged);
}
public void OnConfigsExecuted()
{
alltalkWas = sv_alltalk.BoolValue;
}
public void OnGhostPickUp(int client)
{
alltalkWas = sv_alltalk.BoolValue;
sv_alltalk.BoolValue = false;
}
public void PushOnGhostDrop(int client)
{
sv_alltalk.BoolValue = alltalkWas;
}
void AlltalkChanged(ConVar convar, const char[] oldValue, const char[] newValue)
{
alltalkWas = newValue[0] != 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment