module_hooks

An example module hooking system, will be used in PySAMP.

Example:

python/__init__.py:

import pysamp.callbacks
from . import vehicles


def OnVehicleDeath(vehicleid: int) -> None:
    print(f'From module "{__name__}": Vehicle {vehicleid} died!')


pysamp.callbacks.hook()

python/vehicles.py:

def OnVehicleDeath(vehicleid: int) -> None:
    print(f'From module "{__name__}": Vehicle {vehicleid} died!')
GitHub - Cheaterman/module_hook at pythonawesome.com
Example module hooking system, will be used in PySAMP. - GitHub - Cheaterman/module_hook at pythonawesome.com