Difference between revisions of "NML:Disable items"

From GRFSpecs
Jump to navigationJump to search
(content of nml r1625)
 
(fix example)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
  +
{{NMLNavBlocksyntax}}
  +
 
With a <code style="color:darkgreen">disable_item</code> statement, it's possible to disable one or more existing items. This works for vehicles, houses, industries, cargos and airports. The general syntax is:
 
With a <code style="color:darkgreen">disable_item</code> statement, it's possible to disable one or more existing items. This works for vehicles, houses, industries, cargos and airports. The general syntax is:
   
Line 7: Line 9:
 
<pre style="color:blue">
 
<pre style="color:blue">
 
/* disable all monorail and maglev vehicles */
 
/* disable all monorail and maglev vehicles */
disable(FEAT_TRAINS, 54, 115);
+
disable_item(FEAT_TRAINS, 54, 115);
 
</pre>
 
</pre>

Latest revision as of 22:58, 22 December 2011

Block Syntax

With a disable_item statement, it's possible to disable one or more existing items. This works for vehicles, houses, industries, cargos and airports. The general syntax is:

disable_item(feature[, first_id[, last_id]]);

feature specifies the feature of the item(s) to disable. If no further arguments are given, all default items of that feature are disabled. If one more argument (first_id) is given, only that ID is disabled. With two more arguments, all items from first_id up to and including last_id are disabled. For lists of default IDs, consult the documentation about that feature. An example:

 /* disable all monorail and maglev vehicles */
 disable_item(FEAT_TRAINS, 54, 115);