Servers/GettingStarted: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
m (PerikiyoXD moved page GettingStarted to Servers/GettingStarted: Namespacing)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Getting Started}}
{{DISPLAYTITLE:Getting Started}}
== General Stages ==
{{BlueInformationBox|1=This guide explains how to '''create and run a server'''. If you only want to join and play on an existing server, this page is not required.}}


Download the server files on the Downloads page at [https://gtaconnected.com gtaconnected.com].
= Getting Started =


Extract the server files to an empty folder.
== Overview ==


Change settings in server.xml.
Setting up a server involves four main steps:


Run Server.exe.
# Download the server package from the [https://gtaconnected.com/downloads Downloads] page.
# Extract the files to a new, empty folder.
# Configure your server settings in <code>server.xml</code> (see [[ServerConfiguration|Server Configuration]]).
# Start the server executable.


== Player Spawning and Camera Fading ==
Executable names:
'''For the 3D universe games only (III, VC, SA)'''<br>
* '''Windows:''' <code>Server.exe</code>
The default resource, called "freeroam", includes spawning the player and fading the camera. If you are not using this default resource, be sure to spawn the player and fade the camera using [[spawnPlayer|spawnPlayer]] and [[gta.fadeCamera|gta.fadeCamera]] in a logical event such as in the [[OnPlayerJoined|onPlayerJoined]] event.
* '''Linux:''' See [[LinuxServer|Linux Server]] for available launch methods and instructions.


== Manual ==
Once started successfully, the server will begin listening for incoming connections.


Check the [[ServerManual|Server Manual]] page.
== Server Configuration ==


== Creating a New Resource ==
All core settings are stored in <code>server.xml</code>. This includes:


==== Add your resource to server.xml ====
* Server name
Open file "server.xml" in a text editor, such as Notepad or Notepad++. The file is found in your server folder.<br>
* Port settings
Scroll down to the "<resources>" tag, which is currently at the bottom of the xml file.<br>
* Resource loading
Add a "<resource>" tag inside the "<resources>" tag, and give it an attribute with the name "src" and a value of the name of your new resource.<br>
* Player limits
For example:
* Networking options
{{CodeSyntax|1=<resources>
<!-- you will need to put the resources in the folder before any work -->
<resource src="freeroam" />
<resource src="my_new_resource" />
</resources>}}


==== Create folder for your resource ====
Refer to [[ServerConfiguration|Server Configuration]] for a full list of available settings and explanations.
Open the "resources" folder, which is found in your root server directory.<br>
Create a new folder called "my_new_resource".


==== Create meta.xml for your resource ====
After modifying the configuration, restart the server for changes to take effect.
Create a file called "meta.xml" inside your "my_new_resource" folder.<br>
Add the following XML text to your meta.xml file:<br>
{{CodeSyntax|1=<meta>
<info author="your_username_here" description="Description for your new resource here." />


<script src="my_server_script.js" type="server" language="javascript" />
== Game Mode Setup ==
<script src="my_client_script.js" type="client" language="javascript" />
</meta>}}


==== Edit meta.xml for your resource ====
=== GTA IV (Rockstar Modes) ===
Fill in the defaults for the <info> tag, which include the author and description attributes.<br>
A resource doesn't need to have both server and client scripts, however this example includes both.<br><br>


A <script> tag is needed for each script (file) in your resource.<br>
To use Rockstar’s built-in game modes (Party Mode sessions):
The src attribute for the <script> tag, is the filename of a script, which will be inside your "my_new_resource" folder.<br>
A script can also be in a folder, or a folder in a folder, etc, inside your "my_new_resource" folder.<br><br>


The type attribute for the <script> tag, can be either "server" or "client".<br>
# Navigate to the <code>resources</code> folder.
Server scripts run on the server, client scripts run on the client.<br>
# Delete the <code>freeroam</code> folder.
Different scripting functionality is provided for the server and the client.<br><br>
# Open <code>server.xml</code>.
# Remove the line:
<pre><resource src="freeroam" /></pre>


The language attribute for the <script> tag, can be "javascript", "lua", or "squirrel".<br>
Start the server normally.
A resource can use multiple languages, if desired.<br>
 
It is also possible to transfer data between different languages, both in the same resource or in different resources, if desired.<br><br>
Players who connect will enter a generic rendezvous lobby using Party Mode. From there:
 
* Players can use the in-game phone.
* Sessions can be created or joined directly.
 
=== GTA III, Vice City, San Andreas, and IV (Custom / Scripted Modes) ===
 
For scripted servers:
 
* Example scripts are available here:
  [https://github.com/VortrexFTW/v-essentials v-essentials examples]
 
If creating your own scripts, you must at minimum:
 
* Spawn the player.
* Fade in the camera using [[gta.fadeCamera|gta.fadeCamera]].
* Trigger this logic in an appropriate event, such as [[OnPlayerJoined|onPlayerJoined]].
 
The default <code>freeroam</code> resource:
 
* Handles spawning and camera fade.
* Is designed for GTA III.
* May require modification for other games.
 
We also provide a [[MinimalResourceSkeleton|Minimal Resource Skeleton]] that you can use to start on your own.
 
== Resources ==
 
Resources control gameplay logic, scripts, and custom functionality.
 
See [[Resources|Resources]] for:
 
* Resource structure
* Loading and unloading
* Script organization
* Best practices
 
== Modules ==
 
Modules extend server functionality with native integrations such as:
 
* MySQL
* SQLite
* INI file handling
* Additional system-level features
 
See [[Modules|Modules]] for usage instructions.
 
Additional modules are available on the forum:
[https://forum.gtaconnected.com/index.php?board=24.0 Modules Board]
 
Developers with C or C++ experience can create custom modules using the:
[https://gtaconnected.com/downloads/ModuleSDK.7z Module SDK]
 
== Server Manual ==
 
For in-depth documentation covering commands, configuration, scripting, and advanced topics, see the [[ServerManual|Server Manual]].
 
== Next Steps ==
 
After your server is running:
 
* Verify connectivity (see port forwarding documentation if hosting from home).
* Test resource loading.
* Confirm players can join successfully.
* Begin developing or installing additional resources and modules.

Latest revision as of 13:51, 23 February 2026

This guide explains how to create and run a server. If you only want to join and play on an existing server, this page is not required.

Getting Started

Overview

Setting up a server involves four main steps:

  1. Download the server package from the Downloads page.
  2. Extract the files to a new, empty folder.
  3. Configure your server settings in server.xml (see Server Configuration).
  4. Start the server executable.

Executable names:

  • Windows: Server.exe
  • Linux: See Linux Server for available launch methods and instructions.

Once started successfully, the server will begin listening for incoming connections.

Server Configuration

All core settings are stored in server.xml. This includes:

  • Server name
  • Port settings
  • Resource loading
  • Player limits
  • Networking options

Refer to Server Configuration for a full list of available settings and explanations.

After modifying the configuration, restart the server for changes to take effect.

Game Mode Setup

GTA IV (Rockstar Modes)

To use Rockstar’s built-in game modes (Party Mode sessions):

  1. Navigate to the resources folder.
  2. Delete the freeroam folder.
  3. Open server.xml.
  4. Remove the line:
<resource src="freeroam" />

Start the server normally.

Players who connect will enter a generic rendezvous lobby using Party Mode. From there:

  • Players can use the in-game phone.
  • Sessions can be created or joined directly.

GTA III, Vice City, San Andreas, and IV (Custom / Scripted Modes)

For scripted servers:

  • Example scripts are available here:
 v-essentials examples

If creating your own scripts, you must at minimum:

The default freeroam resource:

  • Handles spawning and camera fade.
  • Is designed for GTA III.
  • May require modification for other games.

We also provide a Minimal Resource Skeleton that you can use to start on your own.

Resources

Resources control gameplay logic, scripts, and custom functionality.

See Resources for:

  • Resource structure
  • Loading and unloading
  • Script organization
  • Best practices

Modules

Modules extend server functionality with native integrations such as:

  • MySQL
  • SQLite
  • INI file handling
  • Additional system-level features

See Modules for usage instructions.

Additional modules are available on the forum: Modules Board

Developers with C or C++ experience can create custom modules using the: Module SDK

Server Manual

For in-depth documentation covering commands, configuration, scripting, and advanced topics, see the Server Manual.

Next Steps

After your server is running:

  • Verify connectivity (see port forwarding documentation if hosting from home).
  • Test resource loading.
  • Confirm players can join successfully.
  • Begin developing or installing additional resources and modules.