Vice City: Multiplayer

Server Development => Scripting and Server Management => Script Showroom => Topic started by: ysc3839 on Mar 15, 2019, 12:57 PM

Title: [GAMEMODE] Python Demo
Post by: ysc3839 on Mar 15, 2019, 12:57 PM
Introduction
This 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 instruction
Clone or download the source code first.

Download required binaries
Install required Python package
This 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.