Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Mathews tingtom

View GitHub Profile
@tingtom
tingtom / hl_gamemovement.cpp
Created Jul 10, 2018
HL2 mod snippet - Brush ladders (Credit to https://github.com/whoozzem/SecobMod)
View hl_gamemovement.cpp
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Special handling for hl2 usable ladders
//
//=============================================================================//
#include "cbase.h"
#define USE_CSS_LADDERS
#ifdef USE_CSS_LADDERS
#include "gamemovement.h"
@tingtom
tingtom / c_weapon_gravitygun.cpp
Last active Mar 19, 2019
HL2 mod snippet - Physgun weapon code
View c_weapon_gravitygun.cpp
//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
// $NoKeywords: $
//===========================================================================//
#include "cbase.h"
#include "hud.h"
#include "in_buttons.h"
@tingtom
tingtom / c_worldhint.cpp
Created Jul 26, 2017
HL2 mod snippet - World hints
View c_worldhint.cpp
#include "cbase.h"
#include "fmtstr.h"
//Vgui render stuff
#include "VGuiMatSurface/IMatSystemSurface.h"
#include <vgui_controls/Panel.h>
#include <vgui_controls/Label.h>
#include <vgui/ISurface.h>
//Debugging
@tingtom
tingtom / hl2_player.cpp
Created May 10, 2017
HL2 mod snippet - Looping sprint sounds
View hl2_player.cpp
//Loop sprinting
bool running = (m_fIsSprinting && GetAbsVelocity().Length2D() > 40);
if( running || m_fSprintStart > 0.0f)
{
EmitSound_t t;
t.m_pSoundName = "Player.SprintLoop";
t.m_nFlags = SND_CHANGE_VOL;
if( m_fSprintStart > 0.0f && !running )
{
You can’t perform that action at this time.