PageTemplateSyntax: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Template Name: ScriptItem2 | {{DISPLAYTITLE:Page Template Syntax}} | ||
== Template Name: ScriptItem2 == | |||
{| class="wikitable" | {| class="wikitable" | ||
!Field Name | !Field Name | ||
!Page Type | !Page Type | ||
!Status | |||
!Values | !Values | ||
!Notes | !Notes | ||
Line 10: | Line 12: | ||
|name | |name | ||
|all | |all | ||
|required | |||
|name of the function/event | |name of the function/event | ||
|Including namespaces if applicable, excluding class name if object oriented | |Including namespaces if applicable, excluding class name if object oriented | ||
|name = gta.createBlip | |name = gta.createBlip | ||
|- | |||
|class | |||
|method, property | |||
|required | |||
|name of the class | |||
| | |||
|class = Element | |||
|- | |- | ||
|side | |side | ||
|all | |all | ||
|required | |||
|server, client, or shared | |server, client, or shared | ||
| | | | ||
Line 22: | Line 33: | ||
|type | |type | ||
|all | |all | ||
|required | |||
|function, method, variable, property, event | |function, method, variable, property, event | ||
|Use event for events, use method/property when object oriented, use function/variable otherwise | |Use event for events, use method/property when object oriented, use function/variable otherwise | ||
Line 28: | Line 40: | ||
|games | |games | ||
|all | |all | ||
|required | |||
|iii vc sa iv | |iii vc sa iv | ||
|Game support. One or multiple are supported. Delimit games by a space. | |Game support. One or multiple are supported. Delimit games by a space. | ||
Line 34: | Line 47: | ||
|desc | |desc | ||
|all | |all | ||
|required | |||
|description of the item | |description of the item | ||
|For events, text is automatically added to the start: "The '''event-name''' event is invoked when"<br>Otherwise, text is automatically added to the start: "The '''item-name''' '''item-type''' is used to"<br>A full stop is added to the end of the description if the description doesn't end in one already. | |For events, text is automatically added to the start: "The '''event-name''' event is invoked when"<br>Otherwise, text is automatically added to the start: "The '''item-name''' '''item-type''' is used to"<br>A full stop is added to the end of the description if the description doesn't end in one already. | ||
Line 40: | Line 54: | ||
|arg(1-20) | |arg(1-20) | ||
|function, method, event | |function, method, event | ||
|required if over 0 args | |||
|An argument. | |An argument. | ||
|Syntax: '''type name description''' or '''[type name = defaultValue]'''.<br>For an optional argument, use [] around the type and name and use '''= value''' for the default value. | |Syntax: '''type name description''' or '''[type name = defaultValue]'''.<br>For an optional argument, use [] around the type and name and use '''= value''' for the default value. | ||
Line 46: | Line 61: | ||
|return | |return | ||
|function, method | |function, method | ||
|required | |||
|The return information, for a successful result. | |The return information, for a successful result. | ||
|Syntax: '''type description'''. | |Syntax: '''type description'''. | ||
Line 52: | Line 68: | ||
|freturn | |freturn | ||
|function, method | |function, method | ||
|required | |||
|The return information, for a failed result. | |The return information, for a failed result. | ||
|Syntax: '''type''' or '''type value'''. | |Syntax: '''type''' or '''type value'''. | ||
|void<br>int -1 | |void<br>int -1 | ||
|- | |- | ||
|note | |cancel | ||
|event | |||
|required | |||
|true, false | |||
|Whether the event can be cancelled. | |||
|cancel = true | |||
|- | |||
|readonly | |||
|variable, property | |||
|required | |||
|true, false | |||
|Whether the variable/property is readonly. | |||
|readonly = true | |||
|- | |||
|note<br>note(2-20) | |||
|all | |all | ||
|optional | |||
| | | | ||
|A note for the page. | |A note for the page. | ||
|note = Text goes here.<br>note2 = Text goes here. | |note = Text goes here.<br>note2 = Text goes here. | ||
|- | |- | ||
| | |compat<br>compat(1-20) | ||
|event | |all | ||
| | |optional | ||
| | | | ||
| | |Compatibility information. | ||
|compat1 = Text goes here. | |||
|- | |||
|example<br>exampleJS<br>exampleLua<br>exampleSquirrel<br>exampleJSSS<br>exampleJSCS<br>exampleLuaSS<br>exampleLuaCS<br>exampleSquirrelJS<br>exampleSquirrelCS | |||
|all | |||
|optional | |||
|Code. | |||
| | |||
|exampleJS = code here | |||
|- | |||
|cb(1-20)text | |||
|method, function, event | |||
|optional, even if matching arg(1-20) is a callback. | |||
|Text | |||
|Extra description for the callback argument. | |||
|arg1 = function Arg1Name Arg 1 description.<br>cb1text = Extra callback description here. | |||
|- | |||
|cb(1-20)arg(1-20) | |||
|method, function, event | |||
|required if matching arg(1-20) callback receives any arguments. | |||
|A callback argument. | |||
|Syntax: '''type name description'''. | |||
|arg1 = Element element The element that is about to be destroyed. | |||
|- | |||
|} | |} |
Latest revision as of 21:37, 29 November 2022
Template Name: ScriptItem2
Field Name | Page Type | Status | Values | Notes | Examples |
---|---|---|---|---|---|
name | all | required | name of the function/event | Including namespaces if applicable, excluding class name if object oriented | name = gta.createBlip |
class | method, property | required | name of the class | class = Element | |
side | all | required | server, client, or shared | side = shared | |
type | all | required | function, method, variable, property, event | Use event for events, use method/property when object oriented, use function/variable otherwise | type = function |
games | all | required | iii vc sa iv | Game support. One or multiple are supported. Delimit games by a space. | games = iii vc sa iv |
desc | all | required | description of the item | For events, text is automatically added to the start: "The event-name event is invoked when" Otherwise, text is automatically added to the start: "The item-name item-type is used to" A full stop is added to the end of the description if the description doesn't end in one already. |
desc = an element is destroyed |
arg(1-20) | function, method, event | required if over 0 args | An argument. | Syntax: type name description or [type name = defaultValue]. For an optional argument, use [] around the type and name and use = value for the default value. |
arg1 = Element element The element that is about to be destroyed. arg1 = [Element element = localClient.player] Example description. |
return | function, method | required | The return information, for a successful result. | Syntax: type description. | void int Description goes here. |
freturn | function, method | required | The return information, for a failed result. | Syntax: type or type value. | void int -1 |
cancel | event | required | true, false | Whether the event can be cancelled. | cancel = true |
readonly | variable, property | required | true, false | Whether the variable/property is readonly. | readonly = true |
note note(2-20) |
all | optional | A note for the page. | note = Text goes here. note2 = Text goes here. | |
compat compat(1-20) |
all | optional | Compatibility information. | compat1 = Text goes here. | |
example exampleJS exampleLua exampleSquirrel exampleJSSS exampleJSCS exampleLuaSS exampleLuaCS exampleSquirrelJS exampleSquirrelCS |
all | optional | Code. | exampleJS = code here | |
cb(1-20)text | method, function, event | optional, even if matching arg(1-20) is a callback. | Text | Extra description for the callback argument. | arg1 = function Arg1Name Arg 1 description. cb1text = Extra callback description here. |
cb(1-20)arg(1-20) | method, function, event | required if matching arg(1-20) callback receives any arguments. | A callback argument. | Syntax: type name description. | arg1 = Element element The element that is about to be destroyed. |