Calling scripts from other scripts
Includes some basic how-to call a script from another script and namespace explanations
- When calling scripts in other gsc's or csc's:
- Add #using pathandnameoffile
- Use either the name of the file, before it, or the namespace used before the functions you want, followed by two colons (::) and then the function name.
- In the zone file for you map you will need to add the script that has the functions in it you want to call.
Example below is for zm or zombiemode scripts:
#namespace testing;
function test(name)
{
wait(5);
iPrintLnBold(name);
}
#using scripts\zm\mc_test;
level testing::test("MakeCents");
or
level thread testing::test("MakeCents");
scriptparsetree,scripts/zm/mc_test.gsc
Only link need selected and build