/ScavengeSurvive

A PvP SA:MP server script built upon the SIF framework, the aim of the game is to find supplies to help you survive, either alone or in a group. The overall objective is to build a stable community and defend it from hostile players.

Scavenge and Survive gamemode script for SA:MP

A PvP SA:MP server script built upon the SIF framework.

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, tires or locked, they 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.

Development

The gamemode is written in a modular fashion, borrowing a lot of concepts from object-oriented programming. Removing some features can be as simple as removing an #include line.

The "World" scripts are separated and can be completely replaced for a new map.

An API is in the works that will allow developers to fully control and manipulate the gamemode without needing to edit it in any way; allowing for easy, conflict free updating from the master branch.

I encourage people to play around with this code, create a new map and put loot spawns in it, I would love to see what is made!

Setup

  1. Dependencies

Ensure you have ALL the dependencies listed in the master script (the one you compile from!) each #include line has a link to the release page.

  1. "/scriptfiles/" directory

Rename "scriptfiles-folder-structure-and-readmes" to just "scriptfiles". The reason this folder has this name is because I don't want my actual scriptfiles folder on the repo as it contains various things I don't wish to share (such as user accounts and data for the test server) this may change.

(However, the server will cleverly automatically create any missing files/folders when started so this repository folder isn't even required any more!)

  1. Compile!

If you set up all the dependencies correctly, there should be no errors at all. If you have a problem compiling DON'T SUBMIT AN ISSUE HERE! that place is reserved for actual bugs, if you need help, send me an email :)

  1. Set up plugins and filterscripts in your "./server.cfg" file.

Note: The repo contains many filterscripts, most of these are just testing tools and utilities, there are only 2 filterscripts you need to run on a public server:

    filterscripts maps rcon
    plugins streamer sscanf CTime Whirlpool FileManager
  1. Set up gamemode settings in your "./scriptfiles/SSS/settings.json" file

This is included with the repo and it will also self-create if absent. Here is an explanation of each key:

player related settings:

  • allow-pause-map (bool) - enable the map option in the pause menu
  • combat-log-window (integer) - combat log time window in seconds
  • interior-entry (bool) - enable interior entrances
  • vehicle-surfing (bool) - enable vehicle surfing on fast vehicles
  • login-freeze-time (integer) - amount of seconds to freeze player on spawn
  • max-tab-out-time (integer) - amount of seconds that a player can alt tab
  • nametag-distance (float) - set the nametag render distance (0.0 for off)
  • ping-limit (integer) - maximum ping for players
  • player-animations (bool) - enable the standard CJ animations

server related settings:

  • file-check (bool) - perform a full file check on user files
  • gamemodename (string) - server browser gamemode name
  • infomsg-interval (integer) - time between each info message in minutes
  • infomsgs (string array) - array list of periodic information messages
  • motd (string) - message of the day, displayed to players upon connecting
  • rules (string array) - array list of rules
  • staff (string array) - array list of staff members
  • website (string) - the website for whitelist notification message
  • whitelist (bool) - enable whitelist

Enjoy, do whatever you want with it, but keep my name on it :)

Maintenance

Set "file-check" to "1" in "./scriptfiles/SSS/Settings.json" in order to perform a player data file check. This will remove any files that shouldn't be there Such as files that aren't in the "Accounts.db" player table or files with names that aren't valid player names.

Run these queries to remove duplicates from the database:

ALTER TABLE Player RENAME TO Player_old
CREATE TABLE Player (name TEXT,pass TEXT,ipv4 INTEGER,alive INTEGER,karma INTEGER,regdate INTEGER,lastlog INTEGER,spawntime INTEGER,spawns INTEGER,warnings INTEGER,aimshout TEXT,gpci TEXT)
INSERT INTO Player (name,pass,ipv4,alive,karma,regdate,lastlog,spawntime,spawns,warnings,aimshout,gpci) SELECT DISTINCT lower(name),pass,ipv4,alive,karma,regdate,lastlog,spawntime,spawns,warnings,aimshout,gpci FROM Player_old

Downside: table will be re-ordered by "name" column alphabetically.