Gta samp on linux

#Помощь | Установка и запуск SAMP на Linux (Ubuntu/Mint)

Если вас когда-либо посещала идея установки SAMP на операционную систему под управлением Linux, то возможно Вы сталкивались с проблемой запуска игры, созданной под OC Windows на совершенно отличной операционной системе. Известно, что Linux не способен запускать такие игры, как GTA San Andreas, но это не значит, что их нельзя установить. В этом гайде мы разберём то, как без особого труда установить на свой Linux GTA San Andreas, поставить на неё SAMP и установить различные модификации для игры. Данный гайд подойдет для любых Linux систем, основанных на дистрибутиве Ubuntu. Для установки игры мы будем использовать PlayOnLinux и плагин PlayOnLinux Vault.

Шаг первый. Подготовка Linux к установке GTA San Andreas.
Чтобы в будущем не столкнуться с какими-либо проблемами при установке и запуске GTA San Andreas, стоит подготовить систему заранее. Обновите все драйвера, которые могут повлиять на работоспособность игры. Это можно сделать при помощи менеджера драйверов: на каждом дистрибутиве Linux он свой — нужно поискать. Также через менеджер языков стоит скачать русскую локализацию под две кодировки: UTF-8 и CP1251 (Windows-1251). После этого установите последнюю версию PlayOnLinux с официального сайта, через менеджер приложений вашего Linux, либо любым другим возможным способом. Теперь перезагрузите ваш компьютер.

Шаг второй. Настройка PlayOnLinux.
Теперь нам нужно установить правильную версию Wine, чтобы не испытывать проблем во время запуска и процесса игры. Откройте вкладку «Утилиты», потом нажмите на кнопку «Управление версиями Wine». В списке доступных версий Wine найдите версию 3.2 и при помощи кнопки со стрелкой вправо установите её. Перезапустите POL.

Шаг третий. Установка SAMP с помощью плагина POL Vault.
Для начала Вам нужно будет скачать специальных архив , который хранит в себе следующие вещи: GTA:SA (без сюжетной линии), SAMP 0.3.7-R1, CLEO 4.3, SF 5.4.1 Final, MoonLoader 0.27-preview3, SL 2.0 Localization. Поместите его в любое удобное для вас место и направляйтесь в PlayOnLinux. Найдите вкладку «Плагины», откройте её и найдите там плагин «PlayOnLinux Vault». Запустите этот плагин и нажмите кнопку «Далее». В списке выберите вариант «Restore an applications. » и нажмите «Далее». Нажмите на кнопку «Просмотр» и укажите файл, который вы скачали ранее. Далее следуйте указаниям плагина и дождитесь окончания импорта игры в PlayOnLinux.

Шаг четвертый. Настройка оболочки Wine.
Когда SAMP импортировался в PlayOnLinux, вы увидите его в списке игр и приложений. Выделите его мышкой, после этого слева нажмите на кнопку «Настроить». Перейдите во вкладку «Wine» и нажмите на кнопку «Настроить Wine». Откройте вкладку «Графика» и установите нужное вам расширение экрана. Не рекомендуется выставлять полноэкранный режим, так как игра может зависнуть и вам придётся перезагружать компьютер. Ставьте такое разрешение, чтобы в крайнем случае Вы могли закрыть окно при помощи PlayOnLinux. Кстати, сделать это можно во вкладке «Wine», нажав на кнопку «Завершить процессы». Настроив разрешение, сохраняйте изменения и закрывайте окно. Теперь перейдите во вкладку «Основные» окна PlayOnLinux и укажите в поле «Версия Wine» ту версию, что мы устанавливали во втором шаге.

Читайте также:  Операционная система linux дистрибутив ubuntu

Шаг пятый. Запуск игры.
Теперь, когда вы всё настроили, можете запускать SAMP. Выделите мышкой SAMP в списке игр и нажмите кнопку «Запуск». Если всё настроено правильно, у вас должен появиться клиент SAMP. Добавляем сервер, указываем свой ник и запускаем игру. Можете наслаждаться игрой в SAMP на Linux OC.

  • Если вы захотите что-то установить при помощи установщика Windows, откройте вкладку «Настроить», перейдите во вкладку «Разное» и нажмите на кнопку «Выполнить файл .exe на этом виртуальном диске», укажите нужный вам .exe файл и установите его в папку с GTA. По умолчанию путь к папке с GTA следующий: drive_c/GTA.
  • Если вы хотите закинуть файлы в папку с GTA, просто перейдите во вкладку «Разное» и нажмите на кнопку «Открыть каталог виртуального диска». Устанавливать CLEO, SF и Lua модификации можно абсолютно так же, как вы делаете это на вашей Windows системе. Ничего сверхестественного.
  • Если вы ищите папку со скриншотами и настройками GTA San Andreas и SAMP, то просто найдите папку «GTA San Andreas User Files» в папке с документами на Linux.
  • Если, играя в SAMP, вы заметили, что русские буквы отображаются в чате криво и налезают на друг друга, установите для чата шрифт Verdana. Если русские буквы вообще не отображаются или отображаются в качестве иероглифов, установите языком системы русский с кодировкой UTF-8 и перезапустите ваш компьютер.

Источник

Linux Server

First off, download Linux-server from our website, or go to the SA-MP download page and find the URL for the Linux Server. Then use wget followed by the URL to download the SA-MP Server to your server. Then, extract the files from the archive. You might want to cd to the directory where you want to install the server, e.g /home/user

wget http://files.sa-mp.com/samp037svr_R2-1.tar.gz tar -zxf samp03*.tar.gz cd samp03

Configuring your server

Once you have the files downloaded and extracted browse to the folder where you just installed the server (usually by typing cd /home/user/samp03. Next use your favorite Linux text editor eg: Pico or Nano, edit server.cfg and change the hostname, RCON password, etc — more info is on the server.cfg help and on the Advanced Server Controls page.

Adding Gamemodes/Filterscripts to your server

Maybe you want to run another gamemode than the example gamemodes shipped with SA-MP. In the Script showroom you can find tons of script you might want to run on your server. To add them to your server, just download the desired .amx file to your \gamemodes directory, and edit your server.cfg to run this gamemmode by changing one of those gamemode lines with the files name, excluding the «.amx».

This works nearly the same way with filterscripts. You also can find them in the scripting showroom. To have them on your server just copy the filterscript file to the filterscripts directory and add an entry for the file without the «.amx» at the end of the line beginning with «filterscripts» in your server.cfg.

Читайте также:  Kaspersky rescue disk linux

Running your server

Once you have server.cfg configured the way you want it, simply run the server by using one of the three described ways below. Each way has a description below the picture. I’ve picked the three most popular ways of starting your server, a small SSH script to keep your server running can be found at the bottom of this page.

NOTE: Be sure you set permissions for samp03svr and announce if you want to run an internet server! If you don’t do this, you’ll get a permission denied error. To set permissions, execute chmod 700 * in the SA:MP server directory. It’s NOT a good idea to run the server (or any other program for that matter) under root.

Samp ssh.jpg

Method one

The first method uses the nohup command to keep the server running. nohup is a Linux command that starts a program, which will ignore any SIGHUP signals — disconnect signals. This means that the server will continue running after you close the SSH window you’ve opened before. The ampersand (&) at the end of the command means that the server has to run in the background, so you can continue to execute commands, even after you’ve started the SA-MP server.

A detailed log can be found in the file nohup.out, which will be created in the directory where you execute the command (/home/gta in this case). nohup is installed on most Linux servers.

Method two

Method two allows the SA-MP Server process to run in the background. The advantage of this is that you can continue to work in the shell-environment, so you won’t have to open another window. On some Linux servers, the process will continue to run after the SSH window is closed, but this is not always the case.

There are no log files or whatsoever created. The shell will return the PID of the process just started, 9251 in the example above. This method is supported by all Linux servers.

Method three

This method is the original described one, and most likely the easiest to understand. The server will be running on top, so all errors will be directly visible as output (e.g. segmentation faults). But keep in mind that normal output, as you have on the Windows Server, is not visible on the Linux server.

The server will be shutdown after the window is closed. This method might be the best for scripting and/or debugging purposes, since it’s very clear.

NOTE: If you get an error saying libstdc++ 6 cannot be found, then you have to download it on your server.

Читайте также:  Astra linux стандартный пользователь

Keeping the Server Online

With limited anti-crash options available in the SA-MP Server, there is a large possibility of receiving Segmentation Faults or any other error generated by your (Pawn) gamemode. This will shutdown the server, and you’ll have to start it up yourself again.

Method one

All you need to use the program below is a Linux environment, and the possibility to use cron. This program will check if the samp03svr process is running, and if it isn’t, start it up again. You’ll need to install the following crontab:

*/1 * * * * /path/to/samp/checksamp.sh >/dev/null 2>&1

Help about using crontab can be found here (https://www.adminschoice.com/crontab-quick-reference). checksamp.sh:

#!/bin/sh PROCESS_COUNT=$(ps -fu root | grep samp03svr | grep -v grep | wc -l) case $PROCESS_COUNT in 0) /path/to/samp03svr & ;; 1) #OK, program is already running once ;; *) #OK, program is already multiple times ;; esac

Make sure that you have to correct paths set up, the script won’t work if you haven’t. The script is currently unable to handle multiple SA-MP Servers on the same machine, but works perfectly when there is only one running/needed. You need to chmod the checksamp.sh file to 0755 (+x)!

Method two

If you don’t want to use crontab and if you want to have server log saved to a separate directory on server crash you can use this script.

To keep your server online using this script, first you need to stop your server and then execute it with this command:

#!/bin/sh log=samp.log dat=`date` samp="/path/to/samp/server/samp03svr" cd /path/to/samp/server echo "$ watchdog script starting." >>$ while true; do echo "$ Server exited, restarting. " >>$ mv /path/to/samp/server/server_log.txt /path/to/samp/server/logs/server_log.`date '+%m%d%y%H%M%S'` $ >> $log sleep 2 done

This method will bring your server back up whenever it crashes or when the RCON exit command is issued. It will also save the server log into a separate directory.

Method three

You can also restart the server using this pair of shell scripts. Assumed is that the server is located in the /home/sampsvr directory.

Script number 1 startgtaserver.sh:

#!/bin/bash export GTA_PATH=/home/sampsvr cd $GTA_PATH while [ true ]; do cat /server_log.txt >> /full_server_log.txt rm /server_log.txt touch /server_log.txt ./samp03svr done

This one goes near the server binary.

Second script, named gtaserver.sh:

#!/bin/bash server_start() < screen /home/sampsvr/startgtaserver.sh & # put in full path and name of startup script >server_stop() < killall startgtaserver.sh # your startup script name killall samp03svr # need to put in path to killall if its not in $PATH >server_restart() < server_stop sleep 1 server_start >case "$1" in 'start') server_start ;; 'stop') server_stop ;; 'restart') server_restart ;; *) echo "usage $0 start|stop|restart" esac

Place the script in /usr/local/bin/.

Just change paths in both scripts to yours, then you can start your server by typing gtaserver start, stop server by typing gtaserver stop, and finally restart it by typing gtaserver restart. Make sure the scripts are executable.

Источник

Оцените статью
Adblock
detector