Skip to content

Quick Start

Create an Application

This section describes how to set up an Infernus application locally.

We strongly recommend using the infernus-starter template to scaffold a simple TypeScript project.

You should have basic familiarity with native Pawn development and Node.js.

CLI

The project uses pnpm to manage dependencies, so you'll need to install pnpm first.

You can easily create a project by following the command-line prompts.

sh
pnpm dlx @infernus/create-app@latest create

TIP

Since the CLI internally calls the GitHub HTTP API, it may fail to create the app if your network connection is unreliable. In that case, refer to the Manual section.

Learn about API rate limits

@infernus/create-app is a tool similar to sampctl that manages package dependencies by parsing pawn.json rules. You can use it to manage plugin and open.mp base dependencies with ease.

Cache

WARNING

The cache generated by pnpm dlx can be overly persistent. It is recommended to manually delete the dlx cache from time to time — otherwise, even specifying @latest may still run an outdated version.

  • Windows: C:\Users\%USERNAME%\AppData\Local\pnpm-cache\dlx
  • Linux: ~/.cache/pnpm/dlx

View cache directory

Example

sh
# Install the CLI tool globally
pnpm add @infernus/create-app -g
# Update if already installed globally
pnpm update @infernus/create-app -g

# Create a project
infernus create <appName>

# Install one or more dependencies.
# All operations can specify a version number, similar to npm package syntax.
infernus add openmultiplayer/open.mp samp-incognito/samp-streamer-plugin@^2.9.6
# Install a component dependency
infernus add katursis/Pawn.RakNet@^1.6.0-omp --component
# Production mode (does not copy inc files)
infernus add samp-incognito/samp-streamer-plugin@^2.9.6 -p

# Install all existing dependencies (similar to sampctl ensure)
infernus install

# Same as above, production mode (no inc files copied)
infernus install -p

# Uninstall one or more dependencies
infernus remove openmultiplayer/open.mp samp-incognito/samp-streamer-plugin
infernus remove katursis/Pawn.RakNet

# Update a dependency (updates global cache and applies to current directory)
infernus update openmultiplayer/open.mp

# Update a dependency to a specific version
infernus update openmultiplayer/open.mp@^1.2.0.2670

# Clear the lowest matching version of a single global dependency
infernus cache clean samp-incognito/samp-streamer-plugin@^2.9.6
# Clear all versions of a single global dependency
infernus cache clean samp-incognito/samp-streamer-plugin
# Clear all global cache dependencies
infernus cache clean -a

# Set a GitHub token to resolve API rate limit issues (on-demand).
# Note: the `gh_token` environment variable takes precedence over the global config.
infernus config gh_token <your_github_token>

# Display global configuration
infernus config -l

# Delete a global configuration
infernus config gh_token

Features

  1. Only handles basic plugin dependency management — does not manage pure include libraries.
  2. Installed packages are cached in ~/infernus/dependencies; subsequent installations of the same version copy from cache instead of re-downloading.
  3. Configuration is stored in ~/infernus/config.json, which currently only contains a gh_token setting to address GitHub API rate limits.

Manual

sh
# Clone via HTTPS
git clone https://github.com/dockfries/infernus-starter.git
# or via SSH
git clone git@github.com:dockfries/infernus-starter.git

# If you need raknet, clone the raknet branch
# git clone https://github.com/dockfries/infernus-starter.git -b raknet
# or use SSH
# git clone git@github.com:dockfries/infernus-starter.git -b raknet

# You can also download the repository directly from the GitHub page.

# Enter the project root directory
cd infernus-starter

# Modify the rcon password in config.json.
vim config.json # you don't have to use vim; any editor is fine.

# "rcon": {
#   "password": "changeme" # change changeme to your own password.
#}

WARNING

The repository has removed the necessary files to ensure you always use the latest dependency versions and to reduce repository size. This means you'll need to supply the files manually.

The so/dll files depend on your target server environment — choose the appropriate version accordingly. Linux only needs so; Windows only needs dll.

  1. Download the omp game server, then extract omp-server[.exe] and the components folder into the project root.

  2. Download the samp-node plugin, then extract libnode.so/dll into the project root and samp-node.so/dll into the plugins folder (create it if it doesn't exist).

  3. Download the streamer plugin, then place streamer.so/dll in the plugins folder.

  4. (If you need raknet) download the raknet plugin, then place all files except .inc files into the components folder.

    1. Replace gamemodes/polyfill_raknet.amx with gamemodes/polyfill.amx, or modify the pawn.main_scripts section in config.json.
json
  "pawn": {
    "main_scripts": ["polyfill_raknet 1"],
  },

Install Dependencies & Dev

sh
# Install dependencies
pnpm install

# Run development mode (compile, watch for changes, auto-restart)
pnpm dev

Build

sh
# Build for production
pnpm build

# Run the server
pnpm serve