[GH-ISSUE #1221] [Server Request] Multi Theft Auto #954

Closed
opened 2026-02-27 02:54:30 +03:00 by kerem · 3 comments
Owner

Originally created by @braunsonm on GitHub (Jan 3, 2017).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1221

Would be nice to have MTA implemented if SAMP is being considered. MTA is another popular modification for Grand Theft Auto San Andreas.

I run a popular server on there and would be willing to help test or contribute. I am not good enough in bash to maybe be that much help.
This is a bash script I made to deploy a MTA server using the default resources or use your own Git repository as the source. Not sure if it would be any help to you. (For Debian)

#!/bin/bash

HELP="Usage:

\t[-g GIT_REPO]
\t[-p DB_PASS]
\t[-h HELP]\n"

BINARY="https://linux.mtasa.com/dl/152/multitheftauto_linux_x64-1.5.2.tar.gz"
CONFIG="https://linux.mtasa.com/dl/152/baseconfig-1.5.2.tar.gz"
RESOURCES="https://github.com/multitheftauto/mtasa-resources/archive/master.tar.gz"

while getopts ":a:g:p:h" arg; do
  case $arg in
    g) #g allows the user to initiate a git repository in the deathmatch folder
		GIT_REPO="$OPTARG"
		;;
    h) #h indicates that the user requests to see this script's usage
		printf "$HELP"
		exit
		;;
		p) #p allows the setting of the mysql root password
		DB_PASS="$OPTARG"
		;;
	*)
		printf "$HELP"
		exit -1
		;;
  esac
done

# make sure server is up to date
apt-get -y update && apt-get -y upgrade

# gather binaries
wget -O mta.tar.gz $BINARY
# extract mta server into mta directory
mkdir /opt/mta/
tar xzvf mta.tar.gz -C /opt/mta/ --strip-components=1

# load in the mysql module
wget https://nightly.mtasa.com/files/modules/64/mta_mysql.so
mkdir /opt/mta/x64/modules
mv mta_mysql.so /opt/mta/x64/modules

# fix mysql error
wget https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16
mv libmysqlclient.so.16 /usr/lib

# cleanup
rm -f mta.tar.gz

# install MariaDB
apt-get -y install software-properties-common
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
add-apt-repository 'deb [arch=amd64,i386] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/debian jessie main'
apt-get update

export DEBIAN_FRONTEND=noninteractive
debconf-set-selections <<< "mariadb-server-10.1 mysql-server/root_password password $DB_PASS"
debconf-set-selections <<< "mariadb-server-10.1 mysql-server/root_password_again password $DB_PASS"
apt-get -y install mariadb-server

SQL="CREATE DATABASE IF NOT EXISTS mta;"
mysql -u root -p$DB_PASS -e "$SQL"

# GIT!
if [[ -n "$GIT_REPO" ]]; then

	# install git
  PKG_OK=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed")
  echo Checking for git: $PKG_OK
  if [ "" == "$PKG_OK" ]; then
    echo "git Package not installed. Setting up git."
    apt-get -y install git
  fi

	# generate a ssh key
	ssh-keygen -t rsa -N "" -b 4096 -C "system@owlgaming.net" -f ~/.ssh/id_rsa

	# output the SSH key to the user
	cat ~/.ssh/id_rsa.pub

	# pause while the user adds the key to github
	read -p "You must add the above SSH key to your repository authentication. Press [Enter] key to continue..."

	# install our repository
	git clone $GIT_REPO /opt/mta/mods/deathmatch

else # if no git then initiate some config files to use
  wget -O config.tar.gz $CONFIG
  wget -O deathmatch.tar.gz $RESOURCES

	# extract config files, resources and move into deathmatch directory
	tar xzvf deathmatch.tar.gz
  tar xzvf config.tar.gz
	mv baseconfig/* /opt/mta/mods/deathmatch
  mkdir /opt/mta/mods/deathmatch/resources
  mv mtasa-resources-master/* /opt/mta/mods/deathmatch/resources

	# clean up unnecessary files
	rm -rf baseconfig
  rm -rf mtasa-resources-master
	rm -f deathmatch.tar.gz
  rm -f config.tar.gz
fi

Documentation on deploying a server on linux:
https://wiki.multitheftauto.com/wiki/Installing_and_Running_MTASA_Server_on_GNU_Linux

If I can be any help let me know.

Originally created by @braunsonm on GitHub (Jan 3, 2017). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1221 Would be nice to have MTA implemented if SAMP is being considered. MTA is another popular modification for Grand Theft Auto San Andreas. I run a popular server on there and would be willing to help test or contribute. I am not good enough in bash to maybe be that much help. This is a bash script I made to deploy a MTA server using the default resources or use your own Git repository as the source. Not sure if it would be any help to you. (For Debian) ```bash #!/bin/bash HELP="Usage: \t[-g GIT_REPO] \t[-p DB_PASS] \t[-h HELP]\n" BINARY="https://linux.mtasa.com/dl/152/multitheftauto_linux_x64-1.5.2.tar.gz" CONFIG="https://linux.mtasa.com/dl/152/baseconfig-1.5.2.tar.gz" RESOURCES="https://github.com/multitheftauto/mtasa-resources/archive/master.tar.gz" while getopts ":a:g:p:h" arg; do case $arg in g) #g allows the user to initiate a git repository in the deathmatch folder GIT_REPO="$OPTARG" ;; h) #h indicates that the user requests to see this script's usage printf "$HELP" exit ;; p) #p allows the setting of the mysql root password DB_PASS="$OPTARG" ;; *) printf "$HELP" exit -1 ;; esac done # make sure server is up to date apt-get -y update && apt-get -y upgrade # gather binaries wget -O mta.tar.gz $BINARY # extract mta server into mta directory mkdir /opt/mta/ tar xzvf mta.tar.gz -C /opt/mta/ --strip-components=1 # load in the mysql module wget https://nightly.mtasa.com/files/modules/64/mta_mysql.so mkdir /opt/mta/x64/modules mv mta_mysql.so /opt/mta/x64/modules # fix mysql error wget https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16 mv libmysqlclient.so.16 /usr/lib # cleanup rm -f mta.tar.gz # install MariaDB apt-get -y install software-properties-common apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db add-apt-repository 'deb [arch=amd64,i386] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/debian jessie main' apt-get update export DEBIAN_FRONTEND=noninteractive debconf-set-selections <<< "mariadb-server-10.1 mysql-server/root_password password $DB_PASS" debconf-set-selections <<< "mariadb-server-10.1 mysql-server/root_password_again password $DB_PASS" apt-get -y install mariadb-server SQL="CREATE DATABASE IF NOT EXISTS mta;" mysql -u root -p$DB_PASS -e "$SQL" # GIT! if [[ -n "$GIT_REPO" ]]; then # install git PKG_OK=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed") echo Checking for git: $PKG_OK if [ "" == "$PKG_OK" ]; then echo "git Package not installed. Setting up git." apt-get -y install git fi # generate a ssh key ssh-keygen -t rsa -N "" -b 4096 -C "system@owlgaming.net" -f ~/.ssh/id_rsa # output the SSH key to the user cat ~/.ssh/id_rsa.pub # pause while the user adds the key to github read -p "You must add the above SSH key to your repository authentication. Press [Enter] key to continue..." # install our repository git clone $GIT_REPO /opt/mta/mods/deathmatch else # if no git then initiate some config files to use wget -O config.tar.gz $CONFIG wget -O deathmatch.tar.gz $RESOURCES # extract config files, resources and move into deathmatch directory tar xzvf deathmatch.tar.gz tar xzvf config.tar.gz mv baseconfig/* /opt/mta/mods/deathmatch mkdir /opt/mta/mods/deathmatch/resources mv mtasa-resources-master/* /opt/mta/mods/deathmatch/resources # clean up unnecessary files rm -rf baseconfig rm -rf mtasa-resources-master rm -f deathmatch.tar.gz rm -f config.tar.gz fi ``` Documentation on deploying a server on linux: https://wiki.multitheftauto.com/wiki/Installing_and_Running_MTASA_Server_on_GNU_Linux If I can be any help let me know.
kerem 2026-02-27 02:54:30 +03:00
Author
Owner

@UltimateByte commented on GitHub (Jan 3, 2017):

Hey there. I had this idea already, seems not very easy to add support for this game, but could be very cool.
You seem to know a bit of bash, probably enough to make the step into developing LGSM. You know, that's how i really learned myself :p

I wrote this recently, to help people wanting to get into LGSM development. If you feel like so, you can step in !
https://github.com/GameServerManagers/LinuxGSM/wiki/Developing-LGSM
Ultimately, you'll need this: https://github.com/GameServerManagers/LinuxGSM/wiki/Branching

Otherwise, it might take a while for us to get into it, depending on our availabilities.

<!-- gh-comment-id:270151448 --> @UltimateByte commented on GitHub (Jan 3, 2017): Hey there. I had this idea already, seems not very easy to add support for this game, but could be very cool. You seem to know a bit of bash, probably enough to make the step into developing LGSM. You know, that's how i really learned myself :p I wrote this recently, to help people wanting to get into LGSM development. If you feel like so, you can step in ! https://github.com/GameServerManagers/LinuxGSM/wiki/Developing-LGSM Ultimately, you'll need this: https://github.com/GameServerManagers/LinuxGSM/wiki/Branching Otherwise, it might take a while for us to get into it, depending on our availabilities.
Author
Owner

@braunsonm commented on GitHub (Jan 3, 2017):

Pull request made. @UltimateByte

https://github.com/GameServerManagers/LinuxGSM/pull/1224

<!-- gh-comment-id:270211432 --> @braunsonm commented on GitHub (Jan 3, 2017): Pull request made. @UltimateByte https://github.com/GameServerManagers/LinuxGSM/pull/1224
Author
Owner

@lock[bot] commented on GitHub (Jul 19, 2018):

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:406119451 --> @lock[bot] commented on GitHub (Jul 19, 2018): This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#954
No description provided.