Difference between revisions of "NML:Disable items"

From GRFSpecs
Jump to navigationJump to search
(add nav template)
(fix example)
 
Line 9: 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);