SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 14/03/2018, 11:10 PM   #1
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,943
Reputation: 1468
Default sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

sampctl





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.

See this page for specific use-cases.

Represent sampctl in your signature/releases with the following image:



PHP Code:
// bbcode for SA:MP forums
[URL="http://*******/sampctl"][IMG]https://shields.southcla.ws/badge/sampctl-supported-2f2f2f.svg?style=for-the-badge[/IMG][/URL]
// markdown for GitHub
[![sampctl-supported]([url]https://shields.southcla.ws/badge/sampctl-supported-2f2f2f.svg?style=for-the-badge)](http://*******/sampctl[/url]) 
Some notes regarding why this is being released now:

This is something I've been working on for a while, since late last year, and wanted to keep the user-base low until it was considered production-ready. It has been through quite a lot of testing in both my own projects and quite a few friends of mine who were happy to try the tool in their workflow.

So today, it's time to reveal this tool to the wider SA:MP community hoping you'll find some use in it. Quite a lot of effort has been put into this document and the wiki to on-board users as easily as possible - all the core features are documented on the wiki along with examples and use-cases.

I'm hoping both server owners and Pawn include writers find this useful!

Features

Package Manager

Always have the libraries you need. Inspired by npm.



Build/Run Tool

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



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



Developer Tools

Quickly bootstrap new packages.



SA:MP Server Configuration - no more server.cfg

Manage your server settings in JSON or YAML format



Automatic Server Restart - no more dodgy bash scripts

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



Automatic Server and Plugin Installer

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



Installation

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

Usage

See the landing page or the readme file for the full readme with all commands listed.

Or visit the wiki for all the information you need.



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:

PHP Code:
{
  
"entry""test.pwn",
  
"output""test.amx",
  
"dependencies": ["sampctl/samp-stdlib""Southclaws/formatex"]

Write your quick test code:

Code:

#include <a_samp>
#include <formatex>

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

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

Code:
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:

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

It compiles to this:

Code:
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.

Last edited by [HLF]Southclaw; 16/03/2018 at 12:18 PM.
[HLF]Southclaw is offline   Reply With Quote
Old 14/03/2018, 11:12 PM   #2
TommyB
Beta Tester
 
TommyB's Avatar
 
Join Date: Sep 2010
Location: Texas, USA.
Posts: 155
Reputation: 133
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Wow!
__________________
TommyB is online now   Reply With Quote
Old 14/03/2018, 11:48 PM   #3
Kar
High-roller
 
Kar's Avatar
 
Join Date: May 2010
Location: Black Asylum
Posts: 3,211
Reputation: 498
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Damn, it's amazing!

Discord loves sampctl.
Kar is offline   Reply With Quote
Old 15/03/2018, 12:03 AM   #4
fr0stG
Little Clucker
 
fr0stG's Avatar
 
Join Date: Jun 2017
Posts: 7
Reputation: 3
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer



woah, great work.
fr0stG is offline   Reply With Quote
Old 15/03/2018, 12:20 AM   #5
renatog
Huge Clucker
 
Join Date: Mar 2016
Posts: 350
Reputation: 48
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

A must for any pro pawner.
renatog is offline   Reply With Quote
Old 15/03/2018, 12:37 AM   #6
xXitsgodzillaXx
Huge Clucker
 
xXitsgodzillaXx's Avatar
 
Join Date: Sep 2011
Location: Cloud nine baby.
Posts: 408
Reputation: 13
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Absolutely beautiful! +REP

Edit: I'm having problems installing/running? I run it and the command prompt comes up and closes and that's it?
__________________
Server is still currently in development and is being worked on everyday. So come join on in and see what progress I've made!

xXitsgodzillaXx is offline   Reply With Quote
Old 15/03/2018, 03:50 AM   #7
BulletRaja
Banned
 
Join Date: Dec 2017
Location: India
Posts: 224
Reputation: 20
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

AWESOME + BEAUTIFUL DESIGN
BulletRaja is offline   Reply With Quote
Old 15/03/2018, 04:18 AM   #8
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Russia
Posts: 3,352
Reputation: 824
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

why is it `sampctl package install` and not just `sampctl install` why did add that "package" as second parameter, its so long.

Quote:
Originally Posted by renatog View Post
A must for any pro pawner.
?what?xddddd
__________________
Kaperstone is offline   Reply With Quote
Old 15/03/2018, 05:14 AM   #9
StrikerZ
High-roller
 
StrikerZ's Avatar
 
Join Date: Mar 2016
Location: India
Posts: 1,123
Reputation: 154
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

I've tried this before but I couldn't get the control of it, Imma try it again one more time
__________________
StrikerZ is offline   Reply With Quote
Old 15/03/2018, 06:18 AM   #10
iKarim
Gangsta
 
iKarim's Avatar
 
Join Date: Oct 2015
Posts: 587
Reputation: 133
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Been using it for a while now, make sure to try it out guys, definitely helpful!
iKarim is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] Developer's swiss knife therainycat Tools and Files 29 18/09/2015 04:09 PM
[AJUDA]Perdendo vital ao decorrer do tempo vitorpedro Português/Portuguese 7 03/10/2011 03:55 PM
Server owner resources: client management tools kaisersouse Server Support 20 29/12/2009 09:58 PM


All times are GMT. The time now is 03:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.