SampPy
SampPy is a plugin for SA:MP that allows you to create gamemodes from Python. A fork of PySAMP, which has been abandoned for quite some time.
New features
- Errors and bugs fixed
- Maximum performance
- Complete rewrite of the API in Python
- New functions, callbacks and pre-integrated system
Why use it?
- Ability to expand to other libraries, compared to Pawn that only works within SA:MP
- The API is completely asynchronous
- Multi thread
- Fixes to common SA:MP problems within the API
- Easy to use, safe and stable
Example
from SampPy import server
from SampPy import events
from SampPy import players
# Initialize server class
MyServer = server.SAMPServer(
hostname = 'samp.py server',
mode = 'Freeeroam',
language = 'English'
)
# Event listener
Listener = events.EventListener()
# Test vehicle
MyVehicle = None
@Listener.event
async def on_server_init(server):
print(f'Hostname: {server.hostname}')
print(f'Mode: {server.mode}')
print(f'Language: {server.language}')
MyVehicle = vehicles.Vehicle(411, 324.7817, -1789.8003, 4.7806, 179.8648, 6, 6)
return True
@Listener.event
async def on_player_connect(player):
player.SendClientMessage(-1, f'Welcome to {MyServer.hostname}!')
return True
Gamemodes
List of ready-to-use example gamemodes
Name | Mode |
---|---|
example | Testing |
lvdm | Freeroam/DM |
protect-the-egg | EggWars |
Screenshots
Installation
- Install Python 3.8.6 for x86
- Download the Lastest Release
- Amazing! That's all