• Stars
    star
    238
  • Rank 163,692 (Top 4 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created almost 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.

sampctl

Build Status Go Report Card Ko-Fi FOSSA Status

sampctl-logo

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.

sampctl is a command-line development tool for developing SA:MP Pawn scripts. It includes a package manager, a build tool and a configuration manager.

If that sentence meant nothing to you, don't worry! You'll probably find use in sampctl if you do anything related to the Pawn language. Below are some explanations of what the terms in bold above mean.

  • command-line development tool: Whether you're a seasoned developer or just a beginner, mastering the command-line on Windows and Unix systems is absolutely necessary to speed up your workflow, take advantage of tools (like this one) and just generally improve your knowledge of computing. If you've never opened Cmd, PowerShell (Windows) or Terminal (Mac) then read this guide.
  • Pawn scripts: This includes gamemodes, filterscripts and libraries (includes). sampctl introduces the concept of packages to the SA:MP and Pawn world to make everyone's life easier.
  • package manager: This allows you to easily use and share packages, no more downloading outdated .inc files from solidfiles...
  • build tool: Easily experiment with new versions of the compiler with a simpler setup and automatic download feature.
  • configuration manager: server.cfg files can get messy and unmanageable, sampctl can generate this file automatically from a much cleaner looking JSON or YAML equivalent.

For a quick-start guide, click this link!

Features

As mentioned above, sampctl is a command-line development tool so it has no graphical user interface. The videos below show sampctl being used with Visual Studio Code which is a light-weight text editor that works very well with sampctl to provide the perfect SA:MP/Pawn development environment.

Package Manager

Always have the libraries you need. Inspired by npm.

images/sampctl-package-ensure.gif

Build/Run Tool

Use on the command-line or integrate with any editor.

images/sampctl-package-build-vscode.gif

Easily write and run tests for libraries or quickly run arbitrary code. Utilise the power of Docker to run on any platform!

images/sampctl-package-run-container.gif

Developer Tools

Quickly bootstrap new packages.

images/sampctl-package-init.gif

SA:MP Server Configuration - no more server.cfg

Manage your server settings in JSON or YAML format

images/sampctl-server-init.gif

Automatic Server Restart - no more dodgy bash scripts

Run the server from sampctl and let it worry about restarting in case of crashes.

images/sampctl-server-run.gif

Automatic Server and Plugin Installer

Automatically download Windows/Linux server binaries and plugins when and where you need them.

images/sampctl-server-ensure.gif

Installation

Installation is simple and fast on all platforms so why not give sampctl a try?

Usage

For a list of commands, click here.

Or visit the Wiki site for documentation on each feature..


Overview

sampctl is designed for both development of gamemodes/libraries and management of live servers.

Below is a quick overview of the best features that will help you develop faster.

Package Management and Build Tool

If you've used platforms like NodeJS, Python, Go, Ruby, etc you know how useful tools like npm, pip, gem are.

It's about time Pawn had the same tool.

sampctl provides a simple and intuitive way to declare what includes your project needs. After that you simply let sampctl take care of the downloading and building.

If you release scripts, you know it's awkward to test even simple code. You need to set up a server, compile the include into a gamemode, configure the server and run it.

Forget all that. Just make a pawn.json/pawn.yaml in your project directory with sampctl package init and use sampctl package install to get the includes you need:

{
  "entry": "test.pwn",
  "output": "test.amx",
  "dependencies": ["pawn-lang/samp-stdlib", "Southclaws/formatex"]
}

Write your quick test code:

#include <a_samp>
#include <formatex>

main() {
    new str[128];
    formatex(str, sizeof str, "My favourite vehicle is: '%v'!", 400); // should print "Landstalker"
    print(str);
}

Build with sampctl package build and run it with sampctl package run!

sampctl package run

Server Plugins
--------------
 Loaded 0 plugins.

Started server on port: 7777, with maxplayers: 50 lanmode is OFF.

Filterscripts
---------------
  Loaded 0 filterscripts.

My favourite vehicle is: 'Landstalker'!

You get the compiler output and the server output without ever needing to:

  • visit sa-mp.com/download.php
  • unzip a server package
  • worry about Windows or Linux differences
  • set up the Pawn compiler with your favourite editor
  • make sure the Pawn compiler is reading the correct includes
  • download the formatex include

See documentation for more info.

Server Configuration and Automatic Plugin Download

Use JSON or YAML to write your server config:

{
  "gamemodes": ["rivershell"],
  "plugins": ["maddinat0r/sscanf"],
  "rcon_password": "test",
  "port": 8080
}

It compiles to this:

gamemode0 rivershell
plugins sscanf.so
rcon_password test
port 8080
(... and the rest of the settings which have default values)

What also happens here is maddinat0r/sscanf tells sampctl to automatically get the latest sscanf plugin and place the .so or .dll file into the plugins/ directory.

See documentation for more info.


sampctl

1.10.0 - Southclaws [email protected]

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.

Commands (6)

sampctl server

Usage: sampctl server <subcommand>

For managing servers and runtime configurations.

Subcommands (4)

sampctl server init

Usage: sampctl server init

Bootstrap a new SA:MP server and generates a samp.json/samp.yaml configuration based on user input. If gamemodes, filterscripts or plugins directories are present, you will be prompted to select relevant files.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --version value: the SA:MP server version to use (default: "0.3.7")
  • --dir value: working directory for the server - by default, uses the current directory (default: ".")

sampctl server download

Usage: sampctl server download

Downloads the files necessary to run a SA:MP server to the current directory (unless --dir specified). Will download the latest stable (non RC) server version unless --version is specified.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --version value: the SA:MP server version to use (default: "0.3.7")
  • --dir value: working directory for the server - by default, uses the current directory (default: ".")

sampctl server ensure

Usage: sampctl server ensure

Ensures the server environment is representative of the configuration specified in samp.json/samp.yaml - downloads server binaries and plugin files if necessary and generates a server.cfg file.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the server - by default, uses the current directory (default: ".")
  • --noCache --forceEnsure: forces download of plugins if --forceEnsure is set

sampctl server run

Usage: sampctl server run

Generates a server.cfg file based on the configuration inside samp.json/samp.yaml then executes the server process and automatically restarts it on crashes.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the server - by default, uses the current directory (default: ".")
  • --container: starts the server as a Linux container instead of running it in the current directory
  • --mountCache --container: if --container is set, mounts the local cache directory inside the container
  • --noCache: forces download of plugins

sampctl package

Usage: sampctl package <subcommand>

For managing Pawn packages such as gamemodes and libraries.

Subcommands (9)

sampctl package init

Usage: sampctl package init

Helper tool to bootstrap a new package or turn an existing project into a package.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the project - by default, uses the current directory (default: ".")

sampctl package ensure

Usage: sampctl package ensure

Ensures dependencies are up to date based on the dependencies field in pawn.json/pawn.yaml.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the project - by default, uses the current directory (default: ".")
  • --update: update cached dependencies to latest version

sampctl package install

Usage: sampctl package install [package definition]

Installs a new package by adding it to the dependencies field in pawn.json/pawn.yaml and downloads the contents.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the project - by default, uses the current directory (default: ".")
  • --dev: for specifying dependencies only necessary for development or testing of the package

sampctl package uninstall

Usage: sampctl package uninstall [package definition]

Uninstalls package by removing it from the dependencies field in pawn.json/pawn.yaml and deletes the contents.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the project - by default, uses the current directory (default: ".")
  • --dev: for specifying development dependencies

sampctl package release

Usage: sampctl package release

Creates a release version and tags the repository with the next version number, creates a GitHub release with archived package files.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the project - by default, uses the current directory (default: ".")

sampctl package get

Usage: sampctl package get [package definition] (target path)

Clones a GitHub package to either a directory named after the repo or, if the cwd is empty, the cwd and then ensures the package.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration

sampctl package build

Usage: sampctl package build [build name]

Builds a package defined by a pawn.json/pawn.yaml file.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the project - by default, uses the current directory (default: ".")
  • --forceEnsure: forces dependency ensure before build
  • --dryRun: does not run the build but outputs the command necessary to do so
  • --watch: keeps sampctl running and triggers builds whenever source files change
  • --buildFile value: declares a file to store the incrementing build number for easy versioning
  • --relativePaths: force compiler output to use relative paths instead of absolute

sampctl package run

Usage: sampctl package run

Compiles and runs a package defined by a pawn.json/pawn.yaml file.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the server - by default, uses the current directory (default: ".")
  • --container: starts the server as a Linux container instead of running it in the current directory
  • --build --forceBuild: build configuration to use if --forceBuild is set
  • --forceBuild: forces a build to run before executing the server
  • --forceEnsure --forceBuild: forces dependency ensure before build if --forceBuild is set
  • --noCache --forceEnsure: forces download of plugins if --forceEnsure is set
  • --watch: keeps sampctl running and triggers builds whenever source files change
  • --buildFile value: declares a file to store the incrementing build number for easy versioning
  • --relativePaths: force compiler output to use relative paths instead of absolute

sampctl package template

Usage: sampctl package template <subcommand>

Provides commands for package templates

Subcommands (3)

sampctl package template make

Usage: sampctl package template make [name]

Creates a template package from the current directory if it is a package.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --dir value: working directory for the package - by default, uses the current directory (default: ".")
  • --update: update cached dependencies to latest version

sampctl package template build

Usage: sampctl package template build [template] [filename]

Builds the specified file in the context of the given template.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration

sampctl package template run

Usage: sampctl package template run [template] [filename]

Builds and runs the specified file in the context of the given template.

Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --version value: the SA:MP server version to use (default: "0.3.7")
  • --mode value: runtime mode, one of: server, main, y_testing (default: "main")

sampctl version

Show version number - this is also the version of the container image that will be used for --container runtimes.


sampctl completion

output bash autocomplete code


sampctl docs

Usage: sampctl docs > documentation.md

Generate documentation in markdown format and print to standard out.


sampctl help

Usage: Shows a list of commands or help for one command


Global Flags

  • --verbose: output all detailed information - useful for debugging
  • --platform windows: manually specify the target platform for downloaded binaries to either windows, linux or darwin.
  • --bare: skip all pre-run configuration
  • --help, -h: show help
  • --appVersion, -V: sampctl version

More Repositories

1

fault

Go errors but structured and composable. Fault provides an extensible yet ergonomic mechanism for wrapping errors.
Go
148
star
2

ScavengeSurvive

A PvP SA:MP survival gamemode. The aim of the game is to find supplies such as tools or weapons to help you survive, either alone or in a group.
Pawn
101
star
3

restic-robot

Backups done right... by robots! Restic backup but the robot friendly version.
Go
72
star
4

storyden

With a fresh new take on traditional bulletin board forum software, Storyden is a modern, secure and extensible platform for building communities.
TypeScript
69
star
5

pawn-requests

pawn-requests provides an API for interacting with HTTP(S) JSON APIs.
Pawn
65
star
6

progress2

A SA:MP UI library for rendering progress bars used to visualise all manner of data from health to a countdown timer.
Pawn
59
star
7

supervillain

Converts Go structs to Zod schemas
Go
58
star
8

vscode-pawn

Pawn tools for vscode, powered by sampctl.
TypeScript
47
star
9

cj

CJ is a Discord bot that hangs around in the open.mp/burgershot.gg community discord.
Go
39
star
10

pawn-redis

Redis client for the Pawn language
C++
38
star
11

opt

A simple and ergonomic optional type for Go.
Go
34
star
12

pawn-sublime-language

Pawn language settings for Sublime Text 3. Copied from C++ but with Pawn language and SA:MP specific modifications.
Python
29
star
13

SIF

SIF is a collection of high-level include scripts to make the development of interactive features easy for the developer while maintaining quality front-end gameplay for players.
Pawn
26
star
14

samp-Hellfire

My long running San Andreas Multiplayer project, I aim to fill this gamemode script with as much as possible to accommodate for all player's tastes!
Pawn
24
star
15

samp-servers-api

Deprecated: use https://open.mp/servers and https://api.open.mp/servers now
Go
22
star
16

pawn-json

JSON for Pawn.
Rust
21
star
17

samp-aviation

A basic pitch-based altitude and roll-based heading autopilot for SA-MP. Based on real autopilot behaviour with some adjustments made for the simple physics of San Andreas.
Pawn
21
star
18

samp-logger

Structured logging for Pawn.
Pawn
18
star
19

pawn-uuid

A Pawn plugin that provides a simple UUID version 4 generator function.
C++
16
star
20

pawn-chrono

A modern Pawn library for working with dates and times.
C++
15
star
21

forumfmt

A personal tool for converting from Markdown to BBCode for SA:MP forum.
Go
13
star
22

samp-geoip

A simple library that provides information from IPHub for connected players.
Pawn
13
star
23

pawn-parser

Derived from the Golang scanner/token packages and modified for Pawn code.
Go
13
star
24

samp-weapon-data

With this library you can finely tune weapon damage based on distance. Using min/max range values, a weapon's damage varies depending on the distance between the shooter and the target.
Pawn
13
star
25

sliding-window-counters

Sliding window counters Redis rate limiting implementation for Golang (Based on the Figma API rate limit algorithm)
Go
12
star
26

pawn-env

Provides access to environment variables in Pawn.
C++
12
star
27

result

Go generic result type and utilities
Go
12
star
28

pawn-errors

A minimal, C/Go-esque, error handling library for the Pawn language
Pawn
12
star
29

samp-plugin-boilerplate

Boilerplate setup for a SA:MP plugin - uses CMake, plugin-natives, Docker and sampctl
C++
11
star
30

enumerator

Generate safe and validated enumerated types.
Go
11
star
31

formatex

Slice's formatex because it doesn't have a GitHub repo
Pawn
10
star
32

prisment

Prisma to Ent schema conversion script
Go
10
star
33

go-cex

A Go library for accessing the CeX trade store products API
Go
9
star
34

Pawpy

Threaded Python utility plugin for SA:MP - unifying two of my favourite languages! Run threaded Python scripts from within a SA:MP script.
C++
9
star
35

modio

A binary file IO script designed specifically for modular SA:MP gamemodes.
Pawn
9
star
36

samp-zipline

Create fun and useful ziplines players can use to speed across large areas quickly. Warning: does not work well with laggy players.
Pawn
9
star
37

samp-animbrowse

Browse and search through the entire GTA:SA animation library with ease.
Pawn
8
star
38

pocket

A neat little web library to help you write cleaner HTTP request handlers!
Go
8
star
39

pawn-bcrypt

bcrypt for Pawn.
C++
7
star
40

pawndex

Pawn package list aggregator - uses the GitHub API to find Pawn packages for sampctl
Go
7
star
41

clawsh

A modern shell that breaks all the rules.
Rust
7
star
42

textnot.pictures

Info site for people who post screenshots of text when asking for help. inspired by dontasktoask.com
HTML
7
star
43

pawn-fsutil

fsutil is a file system utility plugin for the Pawn language
C++
7
star
44

thanks

A Go equivalent of github.com/feross/thanks ✨
Go
6
star
45

samp-plugin-mapandreas

C++
6
star
46

samp-qr

Does QR codes, renders them as a grid of pool balls.
Pawn
6
star
47

zcmd

This is merely a GitHub repost of zcmd by @Zeex because it does not exist on GitHub making package management with sampctl difficult.
Pawn
6
star
48

samp-linegen

Generates a line of objects between start point and destination. Useful for ziplines, tunnels, police tape, funky infinite neon strips, etc.
Pawn
6
star
49

samp-object-loader

A simple yet powerful and easy to use map parser for SA:MP. Reads 'CreateObject' (and any varient) lines from .map files with recursive directory listing. Supports RemoveBuildingForPlayer as well as materials and material text.
Pawn
6
star
50

go-hexagonal-architecture

An actually good production ready hexagonal architecture explanation!
5
star
51

homepage

My homepage built with React and Next.js.
JavaScript
5
star
52

pawn-templates

Template rendering for Pawn.
Rust
5
star
53

samp-nolog

SA:MP server plugin to prevent writing to server_log.txt
CMake
5
star
54

samp-objects-api

https://samp-objects.com Backend API service - handles user authentication, uploads from FineUploader and object search queries.
Go
5
star
55

samp-bitmapper

For generating in-game coordinates from a bitmap.
C++
5
star
56

samp-whirlpool

Fork of the Whirlpool cryptography SA:MP plugin originally Y_Less.
Objective-C
5
star
57

samp-prophunt

A SA:MP gamemode inspired by the popular Team Fortress 2 mod "PropHunt" by Darkimmortal.
Pawn
5
star
58

rst

The Resource-Service-Transport system design approach
5
star
59

samp-ini

A simple cache based ini format file parser, stores file contents in memory to manipulate in order to minimise actual file operations.
Pawn
5
star
60

pdf_extractor

Extracts text from PDF files. Utilises multiple cores, does one page on one core at a time.
Python
4
star
61

dockwatch

Go library for watching Docker containers for changes.
Go
4
star
62

pawn-yaml

YAML for Pawn
Pawn
4
star
63

samp-rediscord

SA:MP to Discord plugin built with Redis as the bridge.
Go
4
star
64

cordless-old

Discord but the 1980s terminal version.
Go
4
star
65

samp-camera-sequencer

A library for creating camera sequences using files to store the coordinates and sequence data. A camera sequence is a set of camera nodes and can be loaded from a file created by the editor. Each camera node consists of coordinates and timing data. Comes packaged with an easy to use editor for creating cinematic camera sequences.
Pawn
4
star
66

pawn-levenshtein

Levenshtein distance package for Pawn.
Pawn
4
star
67

wordpress-to-markdown

Convert a wordpress exported XML file to markdown files for Jekyll
Python
4
star
68

codeblockplease

Info site for people who post code without using formatting when asking for help. inspired by dontasktoask.com
HTML
4
star
69

pawndex-frontend

Frontend React app for the Pawndex Pawn Package Indexing API
JavaScript
4
star
70

flow

dt = data transformers
Go
4
star
71

samp-objects-frontend

https://samp-objects.com Frontend application - React app providing an interface to the samp-objects-api service.
TypeScript
4
star
72

qstring

This package provides an easy way to marshal and unmarshal url query string data to and from structs.
Go
3
star
73

fnm-nushell

fnm -> this -> load-env = use fnm in nushell
Go
3
star
74

OnPlayerSlowUpdate

Like OnPlayerUpdate... but slower - every 100ms.
Pawn
3
star
75

yaps

yet another paste site
Rust
3
star
76

gitwatch

Simple Go library for detecting changes in remote Git repositories
Go
3
star
77

pawn-fmt

fmtlib for Pawn
C++
3
star
78

pawn-requests-example

This simple gamemode demonstrates how to use the pawn-requests plugin with jsonstore.io to store player data.
Pawn
3
star
79

invision-community-go

Golang client for the Invision Community forum API
Go
3
star
80

uptime-girl

🎡 She's an uptime girl, she's been living in an uptime world! 🎡 - seriously: an Uptime Robot robot that automatically creates monitors based on container labels.
Go
3
star
81

samp-ladders

Create simple ascend / descend points in your levels where players can move directly up or down. The animation isn't great and looks a bit stupid, but it's the one I thought looked best!
Pawn
3
star
82

pawn-ctime

The original CTime plugin by RyDeR`, with some major stability and quality improvements.
C++
3
star
83

logctx

Package logctx provides a way to decorate structured log entries with metadata added to a `context.Context`.
Go
3
star
84

pawn-package-template

A boilerplate template repository for a Pawn Package. If you're writing a new package, clone this repo as a starting point!
Pawn
3
star
85

bob-the-builder

Just a league of legends team builder.
Go
2
star
86

content-fullpage-scroll

JavaScript
2
star
87

homebrew-sampctl

Homebrew tap for https://github.com/Southclaws/sampctl
Ruby
2
star
88

gta-chaos-discord

Go
2
star
89

modio-py

Python implementation of a reader/writer for the modio binary file format.
Python
2
star
90

watchgraph

`watch` with a graph!
Go
2
star
91

nullable

Go
2
star
92

imagegrid

An example of an image grid using a css-grid layout with (almost) automated distribution and dense packing.
CSS
2
star
93

darkmodescience

An info page about dark mode.
JavaScript
2
star
94

fx-example

An example of how to use Uber's fx library.
Go
2
star
95

go-samp-query

SA:MP Query API for Go
Go
2
star
96

samp-servers-frontend

ReactJS frontend for the http://samp-servers.net RESTful API (https://github.com/Southclaws/samp-servers-api)
JavaScript
2
star
97

machinehead

A docker-compose application manager that deploys and maintains a set of compose projects and provides secret management for them via Vault.
Go
2
star
98

tickerpool

A worker pool of timed tasks, balanced equally to prevent cpu spikes.
Go
2
star
99

samp-attachedit

An object attachment editor for SA:MP. Easy editing of attached objects using the SA:MP client-side on-screen controls.
Pawn
2
star
100

IDArling-docker

Docker image and compose config for IDArling
Dockerfile
2
star