Skip to content

Instantly share code, notes, and snippets.

@vinci6k
vinci6k / aux_drain.py
Last active January 12, 2021 12:21
Control the rate at which aux (suit) power drains during certain activities in Half Life 2: Deathmatch with Source.Python.
# ../aux_drain/aux_drain.py
# Python
from enum import IntEnum
# Source.Python
from core import PLATFORM
from memory import Convention, DataType, find_binary
from memory.hooks import PreHook
from memory.manager import CustomType, TypeManager, Type
@vinci6k
vinci6k / bouncy_entity.py
Last active April 7, 2020 22:25
Make entities bounce in Source Engine games with Source.Python.
# ../bouncy_entity/bouncy_entity.py
# Python
import math
import random
# Source.Python
from entities.dictionary import EntityDictionary
from entities.entity import Entity
from mathlib import Vector
@vinci6k
vinci6k / smooth_fov.py
Last active October 10, 2020 22:46
Smooth field of view (FOV) change in Source Engine games.
# ../smooth_fov/smooth_fov.py
# Source.Python
from players.entity import Player
from engines.server import global_vars
from commands.say import SayCommand
def change_fov(index, target_fov, rate=0.3):
"""Changes a player's field of view (FOV) smoothly.
@vinci6k
vinci6k / fake_crosshair_example.py
Last active July 14, 2018 03:24
Adding a crosshair to unscoped snipers in CSGO.
#fake_crosshair_example.py
from events import Event
from colors import Color
from memory import make_object
from entities.hooks import EntityCondition, EntityPreHook
from players.entity import Player
from players.helpers import index_from_userid
from weapons.entity import Weapon
from messages import HudMsg