Difference between revisions of "Template:Command"
Jump to navigation
Jump to search
(Make permission optional) |
(Typo) |
||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude> | + | <noinclude>This template is used to show the command alongside some additional information in a Table. |
== Usage == | == Usage == | ||
− | <pre | + | <pre>{{Command|command|description|permission|Example|Aliases}}</pre> |
− | == Example == | + | == Parameters == |
− | <pre>{{Command|train| | + | {| class="wikitable" |
+ | ! Parameter: | ||
+ | ! Description: | ||
+ | ! Default: | ||
+ | |- | ||
+ | ! scope="row" style="text-align: left;" | ''Command'' | ||
+ | | The Command itself. You don't have to provide a / before the text. It will be added automatically. | ||
+ | | ''command'' | ||
+ | |- | ||
+ | ! scope="row" style="text-align: left;" | ''Description'' | ||
+ | | The description to display. Can be left blank/ommited for no description. | ||
+ | | | ||
+ | |- | ||
+ | ! scope="row" style="text-align: left;" | ''Permission'' | ||
+ | | The permission(s) this command has. | ||
+ | | | ||
+ | |- | ||
+ | ! scope="row" style="text-align: left;" | ''Example'' | ||
+ | | The Command-example(s) to display. | ||
+ | | | ||
+ | |- | ||
+ | ! scope="row" style="text-align: left;" | ''Aliases'' | ||
+ | | The alternative command options available. | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | |||
+ | == Examples == | ||
+ | |||
+ | === Full Example === | ||
+ | '''Code''' | ||
+ | <pre>{{Command|train setname [name]|Set the name of the selected train|train.command.name|/train setname SomeName|/train name [name]<br>/train rename [name]}}</pre> | ||
'''Result:''' | '''Result:''' | ||
− | {{Command|train|Main command of TrainCarts|train.command.train}} | + | {{Command|train setname [name]|Set the name of the selected train|train.command.name|/train setname SomeName|/train name [name]<br>/train rename [name]}} |
+ | |||
+ | === No permissions === | ||
+ | '''Code''' | ||
+ | <pre>{{Command|train|Main command of TrainCarts}}</pre> | ||
+ | |||
+ | '''Result''' | ||
+ | {{Command|train|Main command of TrainCarts}} | ||
+ | |||
+ | === No Description === | ||
+ | '''Code''' | ||
+ | <pre>{{Command|train||train.command.train}}</pre> | ||
+ | |||
+ | '''Result''' | ||
+ | {{Command|train||train.command.train}} | ||
+ | |||
+ | === With Examples === | ||
+ | '''Code''' | ||
+ | <pre>{{Command|train setname [name]|Set the name of the selected train|train.command.name|/train setname SomeName}}</pre> | ||
− | + | '''Result''' | |
+ | {{Command|train setname [name]|Set the name of the selected train|train.command.name|/train setname SomeName}}</noinclude> | ||
− | {{Command| | + | <includeonly><onlyinclude>{|class="wikitable" style="width: 400px" |
+ | {{#if: {{{2|}}}| | ||
+ | {{!}}+ colspan="2" {{!}} {{{2}}} | ||
+ | {{!}}- | ||
+ | }} | ||
+ | ! style="text-align: left; padding-right: 20px; width: 30%;" {{!}} Command: | ||
+ | | style="font-family: monospace;" {{!}} /{{{1|command}}} | ||
+ | |- | ||
+ | {{#if: {{{5|}}}| | ||
+ | ! style="text-align: left; padding-right: 20px; width: 30%;" {{!}} Aliases: | ||
+ | {{!}} style="font-family: monospace;" {{!}} {{{5}}} | ||
+ | }} | ||
+ | |- | ||
+ | {{#if: {{{3|}}}| | ||
+ | ! style="text-align: left; padding-right: 20px; width: 30%;" {{!}} Permission: | ||
+ | {{!}} {{{3}}} | ||
+ | }} | ||
+ | |- | ||
+ | |} | ||
− | + | {{#if: {{{4|}}}| | |
− | + | {{{!}} class="wikitable" style="width: 400px;" | |
− | + | ! style="text-align: left; padding-right: 20px; width: 30%" {{!}} Examples: | |
− | + | {{!}}- | |
− | + | {{!}} style="font-family: monospace; width: 30%" {{!}} {{{4}}} | |
− | + | {{!}}} | |
− | + | }}</onlyinclude></includeonly> | |
− | |||
− | |||
− | |||
− |
Latest revision as of 17:34, 1 October 2023
This template is used to show the command alongside some additional information in a Table.
Usage
{{Command|command|description|permission|Example|Aliases}}
Parameters
Parameter: | Description: | Default: |
---|---|---|
Command | The Command itself. You don't have to provide a / before the text. It will be added automatically. | command |
Description | The description to display. Can be left blank/ommited for no description. | |
Permission | The permission(s) this command has. | |
Example | The Command-example(s) to display. | |
Aliases | The alternative command options available. |
Examples
Full Example
Code
{{Command|train setname [name]|Set the name of the selected train|train.command.name|/train setname SomeName|/train name [name]<br>/train rename [name]}}
Result:
Command: | /train setname [name] |
---|---|
Aliases: | /train name [name] /train rename [name] |
Permission: | train.command.name |
Examples: |
---|
/train setname SomeName |
No permissions
Code
{{Command|train|Main command of TrainCarts}}
Result
Command: | /train |
---|
No Description
Code
{{Command|train||train.command.train}}
Result
Command: | /train |
---|---|
Permission: | train.command.train |
With Examples
Code
{{Command|train setname [name]|Set the name of the selected train|train.command.name|/train setname SomeName}}
Result
Command: | /train setname [name] |
---|---|
Permission: | train.command.name |
Examples: |
---|
/train setname SomeName |