Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 2.63 KB

README.md

File metadata and controls

63 lines (44 loc) · 2.63 KB

gtan-xsd

XML Schema Definitions for GTA Network

Autocompletion in Visual Studio XML Validation in Visual Studio

How to use

All you need to do is to include this snippet in the root element of your XML file:

xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xmlns="https://gtan.azurewebsites.net/schema/resource"
xsi:schemaLocation="https://gtan.azurewebsites.net/schema/resource 
                    https://gtan.azurewebsites.net/schema/resource/meta.xsd"

The paths have to be replaced according to the type of XML you want to create (e.g. for an ACL.xml you would use the path "schema/resource/acl.xsd"). You can find a list of all the schemas to choose from below as well as a full example.

Note for Visual Studio: By default, Visual Studio disabled the automatic download of schema files. You can either active it in the settings or you can manually download the files and replace the second url in xsi:schemaLocation with the local path of the downloaded schema file.

Example:

<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
        xmlns="https://gtan.azurewebsites.net/schema/server"
        xsi:schemaLocation="https://gtan.azurewebsites.net/schema/server
                            https://gtan.azurewebsites.net/schema/server/settings.xsd">
  
    <servername>Example Testserver</servername>
    <maxplayers>20</maxplayers>
  
    <resource src="freeroam" />
    <resource src="speedometer" />
</config>

Example of a settings.xml for a server

List of schemas & docs

Schema Docs
/schema/resource/acl.xsd https://pyrax.github.io/gtan-xsd/resource/acl.html
/schema/resource/map.xsd https://pyrax.github.io/gtan-xsd/resource/map.html
/schema/resource/meta.xsd https://pyrax.github.io/gtan-xsd/resource/meta.html
/schema/server/settings.xsd https://pyrax.github.io/gtan-xsd/server/settings.html

Schema definitions can also be found in the directory schema.

Credits

XML Elements are based on the GTA Network Wiki.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.