Scripting/Squirrel/Client Functions/Script::LoadScript: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function loads a file. == Syntax == <pre>Script::LoadScript( FileName ) </pre> == Arguments == * '''STRING''' '''FileName''' This is the name of the file, must be a s...")
 
No edit summary
Line 1: Line 1:
This function loads a file.
Loads the specified script file. The script/ directory is automatically prepended. Same as Scripting/Squirrel/Client_Functions/dofile|dofile.


== Syntax ==
== Syntax ==


<pre>Script::LoadScript( FileName ) </pre>
<pre>void Script::LoadScript(filename)</pre>


== Arguments ==
== Arguments ==


* '''STRING''' '''FileName''' This is the name of the file, must be a string.
* '''string''' '''filename''' This is the name of the file, must be a string.


== Example ==
== Example ==
This will load the file named 'test.nut'.
This will load the file named 'test.nut'.


<code lang="squirrel">
<source lang="squirrel">
function Script::ScriptLoad( )
function Script::ScriptLoad()
{
{
 
    Script.LoadScript("test.nut");
LoadScript( "test.nut" );
 
}
}
</code>
</source>


=== Notes ===
=== Notes ===


The event [http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Events/Script::ScriptLoad Script::ScriptLoad] was used in in this example. More info about them in the corresponding pages.
The event [http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Events/Script::LoadScript|Script::LoadScript] was used in in this example. More info about them in the corresponding pages.

Revision as of 03:56, 23 July 2016

Loads the specified script file. The script/ directory is automatically prepended. Same as Scripting/Squirrel/Client_Functions/dofile|dofile.

Syntax

void Script::LoadScript(filename)

Arguments

  • string filename This is the name of the file, must be a string.

Example

This will load the file named 'test.nut'.

function Script::ScriptLoad()
{
    Script.LoadScript("test.nut");
}

Notes

The event [1] was used in in this example. More info about them in the corresponding pages.