Client Function Template: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
mNo edit summary
 
Line 5: Line 5:
== Syntax ==
== Syntax ==


<syntaxhighlight lang="javascript">
<pre>
example.func(arg1, arg2, arg3);
example.func(arg1, arg2, arg3);
</syntaxhighlight>
</pre>


=== Parameters ===
=== Parameters ===
Line 21: Line 21:
== Multiple Syntaxes ==
== Multiple Syntaxes ==


<syntaxhighlight lang="javascript">
<pre>
//Syntax I
//Syntax I
example.func(arg1, arg2, arg3);
example.func(arg1, arg2, arg3);
</syntaxhighlight>
</pre>


<syntaxhighlight lang="javascript">
<pre>
//Syntax II
//Syntax II
example.func(arg1, arg2, arg3, arg4[]);
example.func(arg1, arg2, arg3, arg4[]);
</syntaxhighlight>
</pre>


=== Parameters ===
=== Parameters ===
Line 46: Line 46:
This is a basic explanation about what does the example below do.
This is a basic explanation about what does the example below do.


<syntaxhighlight lang="javascript">
{{ClientsideCode|
<pre>
//Syntax I
//Syntax I
let val = example.func("Washington", 1, 2.0);
let val = example.func("Washington", 1, 2.0);
</syntaxhighlight>
</pre>
}}


<syntaxhighlight lang="javascript">
 
{{ClientsideCode|
<pre>
//Syntax II
//Syntax II
let val = example.func("Washington", 1, 2.0, ['foo', 'bar']);
let val = example.func("Washington", 1, 2.0, ['foo', 'bar']);
</syntaxhighlight>
</pre>
}}


== See Also ==
== See Also ==


* [[Example::Stuff|Example Stuff]]
* [[Example::Stuff|Example Stuff]]

Latest revision as of 14:08, 26 October 2018

Client-Side

This is an example description for a client-side function template.

Syntax

example.func(arg1, arg2, arg3);

Parameters

  • arg1: Explanation of example argument, parameter should be in string type.
  • arg2: Explanation of second example argument, parameter should be in int type.
  • arg3: Explanation of third example argument, parameter should be in double type.

Returned Values

  • true: if the example function has been executed successfully.
  • false: otherwise.

Multiple Syntaxes

//Syntax I
example.func(arg1, arg2, arg3);
//Syntax II
example.func(arg1, arg2, arg3, arg4[]);

Parameters

  • arg1: Explanation of example argument, parameter should be in string type.
  • arg2: Explanation of second example argument, parameter should be in int type.
  • arg3: Explanation of third example argument, parameter should be in double type.
  • arg4: Explanation of fourth example argument, parameter should be in array type.

Returned Values

  • true: if the example function has been executed successfully.
  • false: otherwise.

Examples

This is a basic explanation about what does the example below do.

Client-Side
//Syntax I
let val = example.func("Washington", 1, 2.0);


Client-Side
//Syntax II
let val = example.func("Washington", 1, 2.0, ['foo', 'bar']);

See Also