RU/Meta.xml: Difference between revisions
No edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
{{translate}} | {{translate}} | ||
Этот файл имеет очень важное содержание, которое позволяет загрузить ресурс/режим/карту. Вам нужно указать имена файлов, которые ваш скрипт/режим e (resource) будет использовать в файле '''meta.xml'''. Если вы хотите отображать изображение на экране клиента, клиент должен сначала загрузить его. Чтобы сервер знал, что вы | Этот файл имеет очень важное содержание, которое позволяет загрузить ресурс/режим/карту. Вам нужно указать имена файлов, которые ваш скрипт/режим e (resource) будет использовать в файле '''meta.xml'''. Если вы хотите отображать изображение на экране клиента, клиент должен сначала загрузить его. Чтобы сервер знал, что вы хотите использовать изображение, нужно прописать имя файла в meta.xml. Если вам нужно использовать какие-то настройки для скрипта в качестве переменных, вы можете прописать их в тэге <settings>. | ||
Примечание: Вы можете опробывать простой генератор meta.xml, созданный 50p: http://forum.mtasa.com/viewtopic.php?f=91&t=22247 | Примечание: Вы можете опробывать простой генератор meta.xml, созданный 50p: http://forum.mtasa.com/viewtopic.php?f=91&t=22247 | ||
Revision as of 10:40, 28 August 2009
Этот файл имеет очень важное содержание, которое позволяет загрузить ресурс/режим/карту. Вам нужно указать имена файлов, которые ваш скрипт/режим e (resource) будет использовать в файле meta.xml. Если вы хотите отображать изображение на экране клиента, клиент должен сначала загрузить его. Чтобы сервер знал, что вы хотите использовать изображение, нужно прописать имя файла в meta.xml. Если вам нужно использовать какие-то настройки для скрипта в качестве переменных, вы можете прописать их в тэге <settings>.
Примечание: Вы можете опробывать простой генератор meta.xml, созданный 50p: http://forum.mtasa.com/viewtopic.php?f=91&t=22247
Возможные тэги
Тэги в .xml такие же, как в . html. Файл meta.xml имеет множество тэгов, необходимых ит опциональных. У них есть свои атрибуты.
Possible tags:
- <info /> Information about this resource, possible parameters include (any arbitrary parameters can be used and read using getResourceInfo):
- author: The author of this resource
- version: The version of this resource
- name: The name of this resource
- description: A brief description of this resource
- type: The type of this resource, that can be "gamemode", "script" or "map".
- <script /> Source code for this resource, possible parameters are:
- src: The file name of the source code
- type: The type of source code: "client" or "server"
- <map /> The map for a gamemode, possible parameters are:
- src: .map file name (can be path too eg. "maps/filename.map")
- <file /> A client-side file. Generally these are images, .txd, .col, .dff or .xml files. They'll be downloaded by clients when the resources is started (or on join)
- src: client-side file name (can be path too eg. "images/image.png")
- <include /> Include resources that this resource will use
- resource: Resource name that you want to start with this resource
- <config /> Config file (.xml) can be accessed by resource, possible parameters are:
- src: The file name of the config file
- type: The type of the config file: "client" or "server"
- <export /> This exports functions from this resource, so other resources can use them with call
- function: The function name
- http: Can the function be called via HTTP (true/false)
- <html />
- src: The filename for the HTTP file (can be a path)
- default: The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false)
- raw: The html file is not parsed by the LUA interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false)
- <settings> </settings>
Example
Heres an example of a meta file using some of the tags mentioned:
<meta>
<info author="Slothman" type="gamemode" name="Stealth" />
<config src="help.xml" type="client"/>
<script src="stealthmain_server.lua" />
<script src="noiseblip.lua" />
<script src="mission_timer.lua" />
<script src="gadgets_server.lua" />
<script src="gadgets_client.lua" type="client"/>
<script src="stealthmain_client.lua" type="client"/>
<script src="noisebar.lua" type="client"/>
<script src="spycam.lua" type="client"/>
<file src="riot_shield.txd" />
<file src="riot_shield.dff" />
<file src="riot_shield.col" />
<file src="armor.png" />
<file src="camera.png" />
<file src="cloak.png" />
<file src="goggles.png" />
<file src="mine.png" />
<file src="radar.png" />
<file src="shield.png" />
<include resource="scoreboard" />
<include resource="killmessages" />
<include resource="maplimits" />
<settings>
<setting name="roundlimit" value="[6]" /> <!-- round length in minutes -->
<setting name="teamdamage" value="[1]" /> <!-- 0 for team protection off, 1 for team protection on -->
<setting name="teambalance" value="[1]" /> <!-- difference limit of amount of players between teams -->
<setting name="spazammo" value="[25]" /> <!-- ammo amounts -->
<setting name="m4ammo" value="[100]" />
<setting name="shotgunammo" value="[25]" />
<setting name="sniperammo" value="[20]" />
<setting name="ak47ammo" value="[120]" />
<setting name="rifleammo" value="[40]" />
<setting name="deserteagleammo" value="[45]" />
<setting name="pistolammo" value="[132]" />
<setting name="uziammo" value="[150]" />
<setting name="tec9ammo" value="[150]" />
<setting name="silencedammo" value="[65]" />
<setting name="grenadeammo" value="[4]" />
<setting name="satchelammo" value="[4]" />
<setting name="teargasammo" value="[4]" />
<setting name="molatovammo" value="[4]" />
</settings>
</meta>