Syntax: Select all
# ../vphysics_collision/vphysics_collision.py
# Source.Python
from core import PLATFORM
from entities.entity import Entity
from memory import Convention, DataType
from memory.hooks import PreHook
from memory.manager import CustomType, TypeManager, Type
manager = TypeManager()
VPHYSICS_COLLISION_OFFSET = 161 if PLATFORM == 'windows' else 162
vphysics_collision = Entity.find('prop_physics').pointer.make_virtual_function(
VPHYSICS_COLLISION_OFFSET,
Convention.THISCALL,
(DataType.POINTER, DataType.INT, DataType.POINTER),
DataType.VOID
)
class GameVCollisionEvent(CustomType, metaclass=manager):
# No idea what Type to use.
pass
# void VPhysicsCollision( int index, gamevcollisionevent_t *pEvent )
@PreHook(vphysics_collision)
def vphysics_collision_pre(stack_data):
print(stack_data)