IntroductionThis is a demo gamemode for my Python plugin (https://forum.vc-mp.org/?topic=5079.0). Working in progress.
https://github.com/ysc3839/vcmp-python-demo
Version 1.0 have settings system (settings.yaml (https://github.com/ysc3839/vcmp-python-demo/blob/972ef7906d35e7b627bda7d9ae3e1be0eb1276f0/settings.yaml)) and a teleport system. Vehicles position are from vl8-pb400 (https://bitbucket.org/stormeus/vl8-pb400/src/master/Vehicles.nut) and teleports position are by myself.
This script works with 04rel004-04rel006 (server version v23-v30). Tested with Python 3.6 x64 on both Windows 10 and Ubuntu 18.04.
Deploy instructionClone or download the source code first.
Download required binaries- vcmp-python-plugin (https://github.com/ysc3839/vcmp-python-plugin/releases/tag/v1.0.5) (Rename to "python-cpy36-rel(32/64).(so/dll)" and place in plugins folder.)
- VCMP server (https://forum.vc-mp.org/?topic=5952.0)
Install required Python packageThis project uses pipenv (https://docs.pipenv.org/) to manage packages.
Install pipenv (https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv) and run
pipenv install inside project folder to install packages.
After installing packages. Run
pipenv shell and then start the server.
If you are using Windows, you need to use run_server.bat to start the server. This script sets PYTHONHOME environment variable because Python can not locate virtualenv location. This issue does not exist on Linux so you can start the server directly.