GettingStarted: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Getting Started}}
{{DISPLAYTITLE:Getting Started}}
{{RedInformationBox|1=This guide is for '''creating a server.''' If you just want to join a server and play, this guide is not for you. }}
== General Stages ==
== General Stages ==


Download the server files on the Downloads page at [https://gtaconnected.com gtaconnected.com].
- Download the server files on the [https://gtaconnected.com/downloads Downloads] page.<br>
- Unzip/extract the server files to an empty folder.<br>
- Change settings in server.xml ([[ServerConfiguration|available settings]])<br>
- Run the server executable. For Windows, this will be ''Server.exe''. For Linux, there are several options to do this, see the [[LinuxServer|linux server]] manual page.<br>


Extract the server files to an empty folder.
== GTA IV (Rockstar Modes) ==
First, remove the freeroam resource that comes with the server, by deleting the freeroam folder in resources. Then remove the <code><resource src="freeroam" /></code> line in [[ServerConfiguration|server config]]. The server should launch normally now, and connecting will place you into a generic rendezvous lobby, which uses party mode. You and other players who connect can use the phone in-game to start and join sessions.


Change settings in server.xml.
== GTA III, VC, SA, and IV (Custom Modes/Scripted) ==
 
There are some example scripts [https://github.com/VortrexFTW/v-essentials here]. If you're making your own scripts, at the very minimum you'll need to fade in the camera using [[gta.fadeCamera|gta.fadeCamera]] in a logical event such as in the [[OnPlayerJoined|onPlayerJoined]] event. The default resource provided with the server called "freeroam", includes spawning the player and fading the camera, but is designed for GTA 3 only.  
Run Server.exe.
 
== Player Spawning and Camera Fading ==
 
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.


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


== Creating a New Resource ==
== Resources ==
 
Check the [[Resources|resources]] page for information on how to use resources.
==== Add your resource to server.xml ====
Open file "server.xml" in a text editor, such as Notepad or Notepad++. The file is found in your root server directory.<br>
Scroll down to the "<resources>" tag, which is currently at the bottom of the xml file.<br>
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>
For example:
{{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 ====
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 ====
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" />
<script src="my_client_script.js" type="client" language="javascript" />
</meta>}}
 
==== Edit meta.xml for your resource ====
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>
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>
Server scripts run on the server, client scripts run on the client.<br>
Different scripting functionality is provided for the server and the client.<br><br>


The language attribute for the <script> tag, can be "javascript", "lua", or "squirrel".<br>
== Modules ==
A resource can use multiple languages, if desired.<br>
Modules extend the server with things like MySQL, SQlite, ini, etc. Check the [[Modules|modules]] page for information on how to use modules. There are some basic modules [https://forum.gtaconnected.com/index.php?board=24.0 on the forum]. Anybody with C/C++ skills can create a module using the [https://gtaconnected.com/downloads/ModuleSDK.7z module SDK].
It is also possible to transfer data between different languages, both in the same resource or in different resources, if desired.<br><br>

Latest revision as of 05:18, 5 December 2025

This guide is for creating a server. If you just want to join a server and play, this guide is not for you.

General Stages

- Download the server files on the Downloads page.
- Unzip/extract the server files to an empty folder.
- Change settings in server.xml (available settings)
- Run the server executable. For Windows, this will be Server.exe. For Linux, there are several options to do this, see the linux server manual page.

GTA IV (Rockstar Modes)

First, remove the freeroam resource that comes with the server, by deleting the freeroam folder in resources. Then remove the <resource src="freeroam" /> line in server config. The server should launch normally now, and connecting will place you into a generic rendezvous lobby, which uses party mode. You and other players who connect can use the phone in-game to start and join sessions.

GTA III, VC, SA, and IV (Custom Modes/Scripted)

There are some example scripts here. If you're making your own scripts, at the very minimum you'll need to fade in the camera using gta.fadeCamera in a logical event such as in the onPlayerJoined event. The default resource provided with the server called "freeroam", includes spawning the player and fading the camera, but is designed for GTA 3 only.

Manual

Check the Server Manual page.

Resources

Check the resources page for information on how to use resources.

Modules

Modules extend the server with things like MySQL, SQlite, ini, etc. Check the modules page for information on how to use modules. There are some basic modules on the forum. Anybody with C/C++ skills can create a module using the module SDK.