如何搭建 GTA 5 私服--GTA5私服架设教程

这篇具有很好参考价值的文章主要介绍了如何搭建 GTA 5 私服--GTA5私服架设教程。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

打开官网,点击 下载服务端(非商业),如图所示

如何搭建 GTA 5 私服--GTA5私服架设教程

网页跳转到官方说明文档

如何搭建 GTA 5 私服--GTA5私服架设教程 

 

该说明文档提供了安装在 Windows 和 Linux 上的方法,下面逐一介绍。

Windows

前提条件:

1.Visual C++ Redistributable 2019

2.Git

3.高配置服务器一台

安装步骤

1.创建新文件夹为 D:\FxServer

如何搭建 GTA 5 私服--GTA5私服架设教程

2.下载最新 Windows 端服务器文件:artifacts server

如何搭建 GTA 5 私服--GTA5私服架设教程

 3.解压下载的服务器文件到 FxServer 文件夹中

如何搭建 GTA 5 私服--GTA5私服架设教程

4.克隆cfx-server-data到 D:\FxServer 中,并重名名为 server-data,且与服务器文件夹 server 同级.命令:git clone https://github.com/citizenfx/cfx-server-data.git server-data

如何搭建 GTA 5 私服--GTA5私服架设教程

如何搭建 GTA 5 私服--GTA5私服架设教程

 5.在 server-data 文件夹下创建 server.cfg 配置文件,文件内容来自example server.cfg ,内容如下:

# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# These resources will start by default.
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure rconlog
ensure scoreboard

# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.
sv_scriptHookAllowed 0

# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password "YOURPASSWORD"
#rcon_password ""

# A comma-separated list of tags for your server.
# For example:
# - sets tags "drifting, cars, racing"
# Or:
# - sets tags "roleplay, military, tanks"
sets tags "default"

# A valid locale identifier for your server's primary language.
# For example "en-US", "fr-CA", "nl-NL", "de-DE", "en-GB", "pt-BR"
sets locale "root-AQ" 
# please DO replace root-AQ on the line ABOVE with a real language! :)

# Set an optional server info and connecting banner image url.
# Size doesn't matter, any banner sized image will be fine.
#sets banner_detail "https://url.to/image.png"
#sets banner_connecting "https://url.to/image.png"

# Set your server's hostname
sv_hostname "FXServer, but unconfigured"

# Nested configs!
#exec server_internal.cfg

# Loading a server icon (96x96 PNG file)
#load_server_icon myLogo.png

# convars which can be used in scripts
set temp_convar "hey world!"

# Uncomment this line if you do not want your server to be listed in the server browser.
# Do not edit it if you *do* want your server listed.
#sv_master1 ""

# Add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.fivem:1 group.admin # add the admin to the group

# Hide player endpoints in external log output.
sv_endpointprivacy true

# Server player slot limit (must be between 1 and 32, unless using OneSync)
sv_maxclients 32

# Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
# -> replace "" with the key
set steam_webApiKey ""

# License key for your server (https://keymaster.fivem.net)
sv_licenseKey changeme


中文解释:

# 一般情况下不用修改!
# 只有使用多个服务器协议的时候才需要更改。默认的TCP和UDP端口为30120
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# 默认启动资源。
start mapmanager
start chat
start spawnmanager
start sessionmanager
start fivem
start hardcap
start rconlog
start scoreboard
start playernames

# 允许玩家使用scripthook挂载的修改器,例如lambda菜单。
# 设置为0可以禁用。
sv_scriptHookAllowed 1

# 取消前面的#可以启动RCON,记住你更改的密码。
#rcon_password changeme			#一般用不到

# 服务器标签,中间用逗号隔开
# 例如:
# - sets tags "drifting, cars, racing"
# 或者:
# - sets tags "roleplay, military, tanks"
sets tags "default"

# 设置服务器横幅或者链接横幅的URL
# 大小没有限制,任何图像都可以.
#sets banner_detail "http://url.to/image.png"
#sets banner_connecting "http://url.to/image.png"

# 设置服务器名称
sv_hostname "My new FXServer!"

# 嵌套配置!一般不改。
#exec server_internal.cfg

# 服务器LOGO图标 (96x96 PNG文件)
#load_server_icon myLogo.png

# 可以在脚本中使用的封面。
set temp_convar "hey world!"

# #如果你不想服务器显示在FiveM网页服务器列表,可以把#号删掉。
#sv_master1 ""

# 只能让Steam或者第三方运营商进入你的FiveM服务器?
# 不要忘记Social Club也是第三方提供商!
# 一般不改
#sv_authMaxVariance 1
#sv_authMinTrust 5

# 添加系统管理员。
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.steam:1 group.admin # add the admin to the group

# 在外部输出日志上不显示玩家的信息。
sv_endpointprivacy true

# 服务器人数设置 (必须在 1 到 32)
sv_maxclients 32

# 服务器密钥 (https://keymaster.fivem.net)
sv_licenseKey changeme

 

需要修改的几项有:
sv_hostname:服务器名称,随便写
load_server_icon:服务器列表显示的图标,去掉#表示开启,自定义图片必须是 96x96 分辨率的 png 图片而且放在 server-data 目录中与配置文件同级目录
add_principal identifier.steam:根据注册的账号 ID 添加管理员

6.去FiveM 论坛 注册账户

7.再去获取服务器密钥(序列号申请次数无上限)

如何搭建 GTA 5 私服--GTA5私服架设教程

如何搭建 GTA 5 私服--GTA5私服架设教程

 


8.申请序列号之后将 server.cfg 配置文件最后一项的 changeme 部分替换成上一步申请的序列号即可

如何搭建 GTA 5 私服--GTA5私服架设教程

9.打开终端,输入下面两句命令即可启动服务器:

cd  /d D:\FXServer\server-data
D:\FXServer\server\run.cmd +exec server.cfg

如何搭建 GTA 5 私服--GTA5私服架设教程

注意:若觉得每次启动服务器麻烦,可以新建一个 bat 文件,将上述两句命令粘贴进去,每次启动服务器的时候双击 bat 文件即可

Linux

由于 Linux 搭建方法与 Windows 大同小异,故整理了一个自动化部署脚本

#下载服务器文件
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/1688-c814f804e64c28952269bc5abbac92d7c956f844/fx.tar.xz

#下载资源文件
git clone https://github.com/citizenfx/cfx-server-data.git server-data

#创建文件夹
mkdir -p /usr/local/src/FiveM/server

#解压服务器文件到指定文件夹
tar -xf fx.tar.xz -C /usr/local/src/FiveM/server

#复制资源文件到指定文件夹
cp -r server-data /usr/local/src/FiveM/

#创建配置文件
cat <<EOF >/usr/local/src/FiveM/server-data/server.cfg
# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# These resources will start by default.
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure rconlog
ensure scoreboard

# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.
sv_scriptHookAllowed 0

# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password "YOURPASSWORD"
#rcon_password ""

# A comma-separated list of tags for your server.
# For example:
# - sets tags "drifting, cars, racing"
# Or:
# - sets tags "roleplay, military, tanks"
sets tags "default"

# A valid locale identifier for your server's primary language.
# For example "en-US", "fr-CA", "nl-NL", "de-DE", "en-GB", "pt-BR"
sets locale "root-AQ" 
# please DO replace root-AQ on the line ABOVE with a real language! :)

# Set an optional server info and connecting banner image url.
# Size doesn't matter, any banner sized image will be fine.
#sets banner_detail "https://url.to/image.png"
#sets banner_connecting "https://url.to/image.png"

# Set your server's hostname
sv_hostname "FXServer, but unconfigured"

# Nested configs!
#exec server_internal.cfg

# Loading a server icon (96x96 PNG file)
#load_server_icon myLogo.png

# convars which can be used in scripts
set temp_convar "hey world!"

# Uncomment this line if you do not want your server to be listed in the server browser.
# Do not edit it if you *do* want your server listed.
#sv_master1 ""

# Add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.fivem:1 group.admin # add the admin to the group

# Hide player endpoints in external log output.
sv_endpointprivacy true

# Server player slot limit (must be between 1 and 32, unless using OneSync)
sv_maxclients 32

# Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
# -> replace "" with the key
set steam_webApiKey ""

# License key for your server (https://keymaster.fivem.net)
sv_licenseKey changeme

EOF

 

将脚本中的 changeme 替换成服务器密钥即可部署

启动服务

使用如下命令启动:

cd /usr/local/src/FiveM/server-data 
/usr/local/src/FiveM/server/run.sh +exec server.cfg

切记,不可用 /usr/local/src/FiveM/server/run.sh +exec /usr/local/src/FiveM/server-data/server.cfg 命令启动,会失败,具体原因未知

开机自启

为了做到开机自启,我采用了 Supervisor 的方式(使用 systemctl 方式会无限重启,原因未知):
先创建一个启动服务的脚本 /usr/local/src/FiveM/start.sh:

cd /usr/local/src/FiveM/server-data && /usr/local/src/FiveM/server/run.sh +exec server.cfg

然后在 Supervisor 的配置文件夹 /etc/supervisor/conf.d/ 中新建 FiveM 的启动文件 fivem.conf

[program:fivem]
command=/usr/bin/bash /usr/local/src/FiveM/start.sh
directory=/usr/local/src/FiveM
user=root
stdout_logfile=/var/log/fivem.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT

最后使用 supervisorctl reload,选择 y 即可开机自启 FiveM 服务

[root@centos ~]# supervisorctl status
fivem                            RUNNING   pid 3316, uptime 5:24:59

 实时日志如下(每三分钟发一次心跳):

[root@centos ~]# tail /var/log/fivem.log -f
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110

连接情况(服务器需要添加 30120 的 TCP 和 UDP 入站规则): 

[root@VM_0_7_centos ~]# lsof -i:30120
COMMAND    PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
ld-musl-x 3317 root   28u  IPv4 36571478      0t0  TCP VM_0_7_centos:30120->150.116.85.124:55130 (ESTABLISHED)
ld-musl-x 3317 root   31u  IPv4 36470180      0t0  TCP *:30120 (LISTEN)
ld-musl-x 3317 root   33u  IPv6 36470181      0t0  UDP *:30120
ld-musl-x 3317 root   35u  IPv4 36476879      0t0  TCP VM_0_7_centos:30120->201.75.45.121:52624 (ESTABLISHED)
ld-musl-x 3317 root   36u  IPv4 36477004      0t0  TCP VM_0_7_centos:30120->67.166.27.29:57882 (ESTABLISHED)
ld-musl-x 3317 root   37u  IPv4 36509773      0t0  TCP VM_0_7_centos:30120->adria.kvarteto.net:50084 (ESTABLISHED)
ld-musl-x 3317 root   38u  IPv4 36483951      0t0  TCP VM_0_7_centos:30120->cable-188-2-205-27.dynamic.sbb.rs:52447 (ESTABLISHED)
ld-musl-x 3317 root   39u  IPv4 36484090      0t0  TCP VM_0_7_centos:30120->49.230.56.194:50631 (ESTABLISHED)
ld-musl-x 3317 root   40u  IPv4 36571801      0t0  TCP VM_0_7_centos:30120->176.148.208.253:58608 (ESTABLISHED)
ld-musl-x 3317 root   41u  IPv4 36484632      0t0  TCP VM_0_7_centos:30120->179.219.232.155:55005 (ESTABLISHED)
ld-musl-x 3317 root   42u  IPv4 36488632      0t0  TCP VM_0_7_centos:30120->client-201.230.158.233.speedy.net.pe:13723 (ESTABLISHED)
ld-musl-x 3317 root   43u  IPv4 36489318      0t0  TCP VM_0_7_centos:30120->112.201.139.65.pldt.net:ema-sent-lm (ESTABLISHED)
ld-musl-x 3317 root   44u  IPv4 36504202      0t0  TCP VM_0_7_centos:30120->cpc69049-oxfd25-2-0-cust839.4-3.cable.virginm.net:55972 (ESTABLISHED)
ld-musl-x 3317 root   45u  IPv4 36509900      0t0  TCP VM_0_7_centos:30120->106.203.63.106:64732 (ESTABLISHED)
ld-musl-x 3317 root   46u  IPv4 36490560      0t0  TCP VM_0_7_centos:30120->177.155.219.25:58726 (ESTABLISHED)
ld-musl-x 3317 root   47u  IPv4 36510686      0t0  TCP VM_0_7_centos:30120->187.21.113.230:51463 (ESTABLISHED)
ld-musl-x 3317 root   48u  IPv4 36509557      0t0  TCP VM_0_7_centos:30120->pc-252-52-100-190.cm.vtr.net:50904 (ESTABLISHED)
ld-musl-x 3317 root   49u  IPv4 36492966      0t0  TCP VM_0_7_centos:30120->170.254.133.248:4657 (ESTABLISHED)
ld-musl-x 3317 root   50u  IPv4 36512199      0t0  TCP VM_0_7_centos:30120->93-86-107-145.dynamic.isp.telekom.rs:58530 (ESTABLISHED)
ld-musl-x 3317 root   51u  IPv4 36523715      0t0  TCP VM_0_7_centos:30120->c-71-193-90-215.hsd1.mn.comcast.net:64846 (ESTABLISHED)
ld-musl-x 3317 root   52u  IPv4 36515098      0t0  TCP VM_0_7_centos:30120->37.236.124.65:60517 (ESTABLISHED)
ld-musl-x 3317 root   53u  IPv4 36524821      0t0  TCP VM_0_7_centos:30120->ppp-223-24-144-28.revip6.asianet.co.th:11693 (ESTABLISHED)
ld-musl-x 3317 root   54u  IPv4 36522366      0t0  TCP VM_0_7_centos:30120->c-98-192-236-150.hsd1.de.comcast.net:58986 (ESTABLISHED)
ld-musl-x 3317 root   55u  IPv4 36522517      0t0  TCP VM_0_7_centos:30120->190.200.255.39:17832 (ESTABLISHED)
ld-musl-x 3317 root   56u  IPv4 36525992      0t0  TCP VM_0_7_centos:30120->cm-27-145-135-149.revip12.asianet.co.th:52631 (ESTABLISHED)
ld-musl-x 3317 root   57u  IPv4 36531724      0t0  TCP VM_0_7_centos:30120->73.126.70.158:50722 (ESTABLISHED)
ld-musl-x 3317 root   58u  IPv4 36555357      0t0  TCP VM_0_7_centos:30120->cpc139088-jarr15-2-0-cust109.16-2.cable.virginm.net:52928 (ESTABLISHED)
ld-musl-x 3317 root   59u  IPv4 36531740      0t0  TCP VM_0_7_centos:30120->c-174-50-61-97.hsd1.la.comcast.net:52188 (ESTABLISHED)
ld-musl-x 3317 root   60u  IPv4 36551137      0t0  TCP VM_0_7_centos:30120->187.21.84.137:65142 (ESTABLISHED)
ld-musl-x 3317 root   61u  IPv4 36555172      0t0  TCP VM_0_7_centos:30120->77.202.162.69:54845 (ESTABLISHED)
ld-musl-x 3317 root   62u  IPv4 36563973      0t0  TCP VM_0_7_centos:30120->199.199.246.200:63485 (ESTABLISHED)

注意:因为我是放在服务器上的,所以刚搭建完没多久就有客户端连接上来了

资源占用情况:

如何搭建 GTA 5 私服--GTA5私服架设教程

 

如何搭建 GTA 5 私服--GTA5私服架设教程文章来源地址https://www.toymoban.com/news/detail-469159.html

到了这里,关于如何搭建 GTA 5 私服--GTA5私服架设教程的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 魔兽世界私服架设教程—魔兽大服务器合并列表

    都说魔兽世界是最经典的网游,可惜我沉迷于程序的世界, 用以下命令down源码 git clone git://github.com/mangos/mangos.git 编译的时候会出错,找不到以下两个文件 revision.h SystemConfig.h 其实以上文件只是简单的定义同个编译的宏而已,自己动手写一个就可以了! 然后编译就没有问题了

    2023年04月18日
    浏览(81)
  • 梦幻西游H5私服服务端超详细图文架设教程

    想体验经典Q版西游霸服高兴吗?想体验满级VIP的尊贵吗?想体验一招秒杀的痛快吗?各种极品配备、翅膀、宠物统统给你,就在梦幻西游! 本文解说梦幻西游H5游戏的架设教程,想钻研H5游戏如何实现,体验游戏中秒天秒地秒空气的肯定不要错过。 1.架设条件 梦幻西游架设须

    2024年02月11日
    浏览(24)
  • GTA5线上小助手角色编辑器代码详解

    GTA5线上小助手 是一个非常受欢迎的游戏辅助工具,它可以帮助玩家更好的玩游戏,其中最受欢迎的功能之一就是角色编辑器。通过角色编辑器,玩家可以自定义自己的游戏角色,包括外观、技能、属性等方面。下面将详细介绍GTA5线上小助手角色编辑器代码。 一、什么是GT

    2024年02月02日
    浏览(192)
  • CSOL 2014 搭建 架设教程 阿里云 腾讯轻量云等通用

    链接:https://pan.baidu.com/s/1MCMoSAP_8-neSoDfIMrQbg?pwd=mmsy 提取码:mmsy 下载完毕后解压资源文件 并安装VC运行库 将所有资源文件 放本地一份 放服务器一份 1.TCP 30001 2.UDP 30001 3.TCP 30002 4.TCP 30003 5.UDP 1-65535 阿里 腾讯 开放端口方法自行百度 运行后如下图 如图所示,红框内为数据库默认

    2023年04月20日
    浏览(22)
  • 原神3.2服务端架设服务器搭建教程ubuntu系统(保姆级)

    原神 3.2服务端架设服务器 搭建教程 ubuntu系统 ( 保姆级 ) 大家好,我是艾西今天跟大家分享下 原神 3.2服务端架设ubuntu系统实操教程 准备阶段 : 服务器一台 32h32g起、服务端、客户端、服务器装Ubuntu20.04系统 特别强调:java17直接放在C:Program Files目录下即可 开始操作跟上节

    2024年02月05日
    浏览(34)
  • 服务器搭建原神私服教程

    1. 准备工具 这个端在Windows、Linux系统上都可以跑,本次教程基于Linux。准备如下工具 服务器1台 centos7 系统 最低配置8核16G 如需公网联机可用云服务器 手 保证云服务器的443端口未使用(服务器上没有网站) 2. 环境配置 安装系统依赖环境 安装java SE 17 注意:如果想要使用最新

    2024年02月04日
    浏览(28)
  • 原神服务端搭建架设教程win系统(附客户端+服务端+环境配置)

    大家好,我是艾西原神一款开放世界冒险3D游戏以七种元素(分别为风、雷、岩、火、水、草、冰)交汇的幻想世界“提瓦特”创造的游戏世界,以角色扮演的RPG游戏还是有非常多的玩家热爱,以二次元以及那卡哇伊的画风不管是小哥哥还是小姐姐都深受喜爱。   游戏总体分

    2024年02月12日
    浏览(26)
  • 魔兽世界经典旧世私服搭建教程

    60魔兽经典旧世是最经典的版本,遗憾的是60年代时还在大学读书,穷得很,买不起点卡,后来工作了,大概70年代开始玩的。 多年以前,玩游戏时,一直非常期望能够自己控制角色的属性级别,得到各种装备。 多年以后,在这款纯粹的开源服务器问世后,终于如愿以偿。 直

    2024年02月04日
    浏览(41)
  • 轻松搭建冒险岛服务器-冒险岛私服搭建详细教程

    想要拥有一个属于自己的冒险岛世界吗?想要一步步学习如何架设冒险岛服务器吗?本文将从如何选择服务器、安装系统、配置环境、搭建数据库、部署网站、上传文件、启动服务等8个方面,一步步为大家详细讲解冒险岛架设教程。让你轻松打造属于自己的独特冒险世界。

    2024年02月11日
    浏览(29)
  • 【前车之鉴】: 2023最新教程-将java程序打包到maven私服的正确打开方式,详细流程介绍不怕你掌握不了

    一是当前网络上一些博客有遗漏部分,这里做补充,二是网上思路没错,但是有些关键配置maven官方做了变更,其三:更详细,更面向初次使用的developer 上图所示的步骤基本就是本文的框架,其实打包逻辑比较清晰,仅仅是过程复杂,但有过公司开发经历的同学应该能get到这

    2024年02月11日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包