Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Latest commit

 

History

History
37 lines (24 loc) · 4.58 KB

README.md

File metadata and controls

37 lines (24 loc) · 4.58 KB

Clockwork plugins

A collection of my plugins for the popular roleplaying framework, Clockwork.

My plugins

Descriptions of each of my plugins are found below. Some of the descriptions are technical: for non-technical descriptions, please view my plugins thread on the Cloud Sixteen forums.

Context Menu Always

By default, the Garry's Mod context menu is only available for use when the toolgun is out within Clockwork. This plugin provides an in-game config (labelled "Context Menu Always") which allows you to enable use of the context menu regardless of whether the toolgun is out or not.

Disable Duplicate Step Sound

This plugin removes the issue of duplicated footstep sounds for those using certain models.

Background: Clockwork provides a means to use NPC models as player models, by translating default player movement activities into those which are supported by various NPC models. With certain NPC models, there are default footstep sounds which automatically play when entities using that model take a step, which are not caught by the PlayerFootstep gamemode hook. Due to this, you hear both the footstep sound produced by the model, and that played by the gamemode. The cause of this issue was found with the help of Vizurez.

This plugin takes advantage of the fact that the gamemode hook plays the footstep sound through entityMeta.EmitSound via sound path, whereas the model's step sound utilises a sound name. Step sound names have the suffix of .stepleft or .stepright, so the plugin blocks such sounds when they originate from a player entity.

Disable NPC drops

This plugin implements a config (labelled "Disable NPC Drops") which uses spawn flags to allow the disabling of medkit and weapon dropping by NPCs which are spawned by players.

No Apostrophe Spam

This plugin overrides the string escaping function from Clockwork's database library and replaces all instances of two single quotes ('') with one (').

Background: the GMod SQLite string escaping function, sql.SQLStr, is utilised by Clockwork to escape SQLite strings. As part of the escaping process, it assumes the use of single quotes to surround strings, however Clockwork uses double quotes. This leads to sql.SQLStr needlessly doubling up the single quotes in an attempt to escape the data, which often represents itself in the form of apostrophes in characters' physical descriptions doubling themselves each time the player connects. This is because the data is loaded from the database on join, and then before the player leaves it is re-saved: but with double the single quotes.

Pistol Holster No Shoot

This plugin intercepts and stops the attack usercommand generated when a player uses weapon_pistol whilst it is holstered.

Background: Clockwork implements a holstering mechanism for weapons, so that they cannot be fired when they are lowered. It does this by continually furthering the next primary fire time of the weapon whilst it is holstered. This doesn't work for weapon_pistol, whose programming seems to involve overriding the next primary fire time continually in its ItemPostFrame hook. As such, the weapon_pistol can be shot whilst holstered. To get around this, the plugin stops the attack command before it is even sent, rather than relying on it going through and being stopped based on the next primary fire time. Currently, attacks generated by mouse clicks whilst the context menu is open are not caught by the StartCommand hook. This means that a user with a holstered weapon_pistol with the context menu open will be able to fire their weapon. You can watch this issue here.

Remove Admin News

This plugin removes the CAX-enforced Clockwork News panel which appears on initialization for Clockwork server administrators.

Remove Logo Plugin

This plugin removes the CAX logo plugin, which is responsible for the Clockwork Admin News as well as the Clockwork and schema game introductions.

Staff Request

This plugin implements a /help command for players to declare that they need staff assistance. All staff members are alerted, and any may choose to accept the request, at which point the accepting staff member is teleported to the player for the duration of the help call. Once the staff member is satisfied that the problem is resolved, they can mark is as completed, pending approval from the player who made the initial request. Statistics are kept of how many requests each staffer accepted, how many they marked as completed, and how many of those the player accepted as completed.