This is a .asi plugin that allows writing custom Python scripts for GTA SanAndreas. This plugin is still in the early stages of development so, if you find and bugs or have feature suggestions let me know :)
Python version: 3.8x (Windows 7+)
Sample scripts: here
Plugin template: here
- Install Visual C++ Redistributable 2019 x86 and asi loader
- Download PyLoader.7z and extract everything in the game directory.
Note: You need v1.0 of the game.
Setting up intellisense here
These modules expose the functionality of the game to the python interpreter. Can be imported as normal python modules.
import cleo from cleo import import cleo as cl
To add your own modules, you can place them inside the PyLoader/lib folder. Do not place them inside the PyLoader/libstd as it is reserved for pyloader ones.
For this, you need a local installation of python-pip. From there go to the PyLoader/lib folder run the command,
pip install <package_name> -t .
Creating python modules is pretty straightforward and requires no changes for PyLoader. Check here for examples. For creating advanced modules through C++ check the sample project here. More examples are here.