• Stars
    star
    101
  • Rank 327,532 (Top 7 %)
  • Language Pawn
  • License
    Mozilla Public Li...
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

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.

Scavenge and Survive

Overview

Scavenge and Survive is 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.

The overall objective is to build a stable community and defend it from players with more hostile intentions.

Items spawn around the map in various places categorised by type, rarity and location. Vehicles are rare and spawn with damaged engines or tires and will usually spawn with loot inside the trunk.

No gameplay mechanics require the use of commands. All gameplay has been built with an intuitive interaction model in mind with only 5 major keys required to access the gamemode-specific features.

Getting Started

Requirements

To get started with Scavenge and Survive, you need the following tools installed on your computer:

  • Git To clone the repository and provide functionality to the Runner
  • sampctl To install the necessary Pawn dependencies and SA-MP plugins automatically.
  • The Go Language To build tooling such as the Runner application which will make the development process easier.
  • Taskfile To run common development tasks such as building, running and generating additional assets and data.

Tip: The easiest way to install all of these is with Scoop!

First Time Build & Run

Clone the repository to your computer using Git (Or the GitHub desktop app, if you prefer that)

git clone https://github.com/Southclaws/ScavengeSurvive.git

Now, open the directory in your favourite IDE. I recommend vscode. As long as you have a terminal in there, you'll be fine.

Run the following commands to pull the Pawn dependencies, SA-MP plugins, compiler and other necessary components:

sampctl package ensure
sampctl package build

When on master branch, this should finish with no errors. You can check the state of the master branch here: https://github.com/Southclaws/ScavengeSurvive/actions?query=workflow%3Abuild if the topmost item has a βœ… then the latest commit on master will compile with no errors.

Now, build and run the runner with:

task

This will run the default task which will compile and run the Runner. This application runs in the background while you develop and will keep the server running.

Development Workflow

Now you can edit code and leave the Runner in the background. The runner will not automatically recompile the gamemode unless you set AUTO_BUILD. Generally, it's best to separate this process so use sampctl for builds instead.

Once you have made a change and are ready to test, go in-game and use the /restart command with 0 to restart the server immediately.

.env

You can place environment variables in a file named .env in the root directory of the repository. For a list of configuration options, see runner/config.go. The environment variable names are the ones after envconfig in "UPPER_SNAKE_CASE".

Deployment

The recommended deployment strategy is to use Docker. This project comes with a Dockerfile and a docker-compose.yml so it's ready to go.

Assuming you have a server (baremetal or virtual), clone the source to the machine either manually or using an automation tool such as Pico

git clone https://github.com/Southclaws/ScavengeSurvive.git

Now you just need to run Docker Compose, which will build the image if necessary and run it - detach in order to daemonise the server. It's exposed on port 7777 udp by default.

docker-compose up -d

Architecture

The image uses the Runner as the entrypoint. This keeps the server running and performs restarts internal to the container - this means the container will not close unless a catastrophic error occurs. Because of this, you should leave auto-restart for the container disabled and manually intervene if anything goes wrong.

The container expects the entire repository to be mounted into it. This may seem counterintuitive but this is to facilitate safe restarts without complicating the application architecture.

Updating the Server

When a new version is released, git pull inside the repository (Or, if you're using Pico, this will be done automatically) and let the Runner automatically rebuild the server while it's running. See below to learn more about automatic update scheduling.

Runner

The Runner is a simple wrapper around the server binary. It simply keeps the server running and is suitable for use in development and production.

Automatic Update Scheduling

When the launcher detects a new ScavengeSurvive.amx file has been compiled, it will signal to the game server that an update is ready. This will trigger the game server to schedule a restart in 1 hour.

Logging

The runner will automatically parse all log output and re-write it to stdout after parsing it. It will parse samp-logger format output and output it using the built-in logger. This means logs can be in JSON or other formats.

All preamble is removed. This means all the nonsense that the SA-MP server and plugins print out during initialisation is removed completely. So all you'll see is a list of plugins:

2020-10-19T02:04:21.566+0100    INFO    finished initialising   {"plugins": ["nolog", "crashdetect", "sscanf", "streamer", "chrono", "pawn", "Whirlpool", "fsutil"]}
2020-10-19T02:04:21.567+0100    INFO    [OnGameModeInit] FIRST_INIT

Auto Restart

If the server crashes - or, more accurately, closes without the runner telling it to, it will automatically restart.

Restart Process Kill

To avoid server closed connection while also doing a full restart without gmx, the process will be killed completely and re-executed when the gamemode finishes its graceful shutdown during a restart.

Auto Build

Set the environment variable AUTO_BUILD to 1 in order to enable automatic builds. This is similar to sampctl's --watch feature.


Open Source

I encourage people to play around with this code, create a new map and put loot spawns in it or completely mod it into a new gamemode, I would love to see what creations are made! Please publish all bug fixes in order to benefit everyone.

That being said, This is not a simple project, you have been warned. I do not have time to provide tech-support so please do not contact me asking me for help compiling the project (sorry!)

Don't Be Selfish

When you fix something, don't keep it to yourself. This is an open source project. An important part of open source is sharing, that's why this code is free of charge and available to all.

Please respect this. Feel free to keep your unique features private, just submit all fixes to the base code as pull requests or just email them to me/post them as issues here.

The License

Short Summary: https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)

Ensure that you understand these key points from the license:

You must make the source code for any of your changes available under MPL, but you can combine the MPL software with proprietary code, as long as you keep the MPL code in separate files. Version 2.0 is, by default, compatible with LGPL and GPL version 2 or greater. You can distribute binaries under a proprietary license, as long as you make the source available under MPL.

And leave all credits intact. This includes any in-game messages.

This block is shown at the top of every source file to indicate it's under MPL:

Copyright (C) 2020 Barnaby "Southclaws" Keene

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

More Repositories

1

sampctl

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

fault

Go errors but structured and composable. Fault provides an extensible yet ergonomic mechanism for wrapping errors.
Go
148
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