Skip to content

Quick Overview

Southclaws edited this page Feb 7, 2018 · 5 revisions

So you've now installed sampctl, what now?

This page covers the general concepts, terminology and use-cases for sampctl. If you read only one page on this wiki, it should be this one.

What Is It?

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.

Use-Cases

There are generally just two tasks you likely want to accomplish:

Compiling Your Code

Tools for this: sampctl package

For this, you want to focus on Packages and the pawn.json file.

sampctl provides tools for managing includes ("dependencies") and compiling Pawn code to .amx files. You should read the page on Modern Pawn and Testing Pawn.

A lot of these documents focus on writing libraries but the concepts are the same for gamemodes.

Hosting a Server

(This does not apply to those of you who use managed hosting solutions)

Tools for this: sampctl server

This is where the samp.json is used.

These tools provide you with a cross-platform way to handle configuration without touching the server.cfg file and automatically download the correct plugin versions for your gamemode.

Terminology

sampctl introduces a few new words, be sure to familiarise yourself with them before asking for help or reading any more of the documentation.

  • package

    • A package is an isolated "box" of Pawn code with a list of dependencies it requires to compile. Read more about packages here.
  • dependency

    • Dependencies are just a fancy word for includes. The difference being you can declare that your code requires them but you don't need to waste time downloading them or searching for the right version. See the package definition docs on the dependencies field or the page on dependencies.
  • library

    • Not a new word but worth a mention as people use the word "include" a lot which essentially means the same thing. A library is an external collection of code you can include into yours to provide more functionality. "Library" is just a more general term that's used more widely across many programming languages.
  • build

    • Another word for "compile" but more focused towards Packages. A package definition file may declare multiple "builds" which means you can have a -d3 debug build, a -O2 optimised build, a -l precompiler-only build, etc. A build also includes dependencies too.
Clone this wiki locally