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

68747470733a2f2f63646e2e646973636f72646170702e636f6d2f6174746163686d656e74732f3731303730313033393033363339393639372f3833323330333830393739393132373134302f756e6b6e6f776e2e706e67

68747470733a2f2f63646e2e646973636f72646170702e636f6d2f6174746163686d656e74732f3731303730313033393033363339393639372f3833323330313931353036343130373030382f73612d6d702d3131382e706e67

68747470733a2f2f63646e2e646973636f72646170702e636f6d2f6174746163686d656e74732f3731303730313033393033363339393639372f3833323330313931383137363031383434322f73612d6d702d3131392e706e67

Installation

  1. Install Python 3.8.6 for x86
  2. Download the Lastest Release
  3. Amazing! That's all

GitHub

https://github.com/RealAtom/SampPy