Interface administrators, moderator
2,603
edits
No edit summary |
|||
Line 1: | Line 1: | ||
== What is a resource? == | == What is a resource? == | ||
A resource is a folder that contains a | A resource is a folder that contains content for a server. This can include scripts, audio, images, game files, etc. | ||
You can reload, start, and stop resources, and you can have more than 1 resource running at the same time. Resources would usually contain a script for game modes or can also contain other tasks to help control/manage the server, add commands, provide separate content, etc. | You can reload, start, and stop resources, and you can have more than 1 resource running at the same time. Resources would usually contain a script for game modes or can also contain other tasks to help control/manage the server, add commands, provide separate content, etc. | ||
== Using resources == | |||
Script files can be created with any of the supported languages: Lua, Squirrel, or JavaScript. These can be mixed in the same resource (although in different files). You can have one file running Lua, another with JavaScript, and another with Squirrel, all working together in the same resource. | |||
== Creating a resource == | == Creating a resource == | ||
To create a resource for the server you would simply create a new folder with the name of the resource. | To create a resource for the server you would simply create a new folder with the name of the resource. | ||
Then to configure it you will need to create a file inside the resource folder named "meta.xml" (without the quotes) and open it in Notepad or your favorite code editor. | Then to configure it you will need to create a file inside the resource folder named "meta.xml" (without the quotes) and open it in Notepad or your favorite code editor. See the Meta File section below to learn how to use it. | ||
Script files can be created with any of the supported languages: Lua, Squirrel, or JavaScript. These can be mixed in the same resource (although in different files). You can have one file running Lua, another with JavaScript, and another with Squirrel, all working together in the same resource. | |||
== Meta File == | |||
Here is an example for the contents of the meta file: | Here is an example for the contents of the meta file: | ||
{{XMLCode|1=<meta> | {{XMLCode|1=<meta> | ||
Line 22: | Line 26: | ||
The language attribute tells the server which language to interpret the script. <br>GTA Connected supports Lua (language="lua"), JavaScript (language="javascript"), and Squirrel (language="squirrel") | The language attribute tells the server which language to interpret the script. <br>GTA Connected supports Lua (language="lua"), JavaScript (language="javascript"), and Squirrel (language="squirrel") | ||
Below is a list of all accepted meta.xml nodes. | Below is a list of all accepted meta.xml nodes. | ||
{{XMLCode|1=<meta> | {{XMLCode|1=<meta> |