This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
building:scripts [2019/03/10 20:49] Mavrixio |
building:scripts [2019/03/26 21:08] (current) murdrkitten |
||
---|---|---|---|
Line 5: | Line 5: | ||
{{:building:scripts_20190310-164551.png}} \\ \\ | {{:building:scripts_20190310-164551.png}} \\ \\ | ||
- | You can also call them from your own script: | + | You can also call them from your own script: <code> |
- | <code> | + | |
void main() | void main() | ||
{ | { | ||
if (GetLocalInt(OBJECT_SELF, "USE_MAV_SYSTEM")) | if (GetLocalInt(OBJECT_SELF, "USE_MAV_SYSTEM")) | ||
{ | { | ||
- | ExecuteScrit(OBJECT_SELF, "mv_awesomesystem"); | + | ExecuteScript("mv_awesomesystem", OBJECT_SELF); |
} | } | ||
else | else | ||
{ | { | ||
- | ExecuteScrit(OBJECT_SELF, "my_system"); | + | ExecuteScript("my_system", OBJECT_SELF); |
} | } | ||
} | } | ||
+ | </code> | ||
+ | |||
+ | And by using the #include directive, you can even bypass the fact that a specific script is "not" accessible on the server that you are building on. Not that you should do that, but at least you should not hesite to #include someone else script instead of re-coding all functions: | ||
+ | <code> | ||
+ | #include "any_script" | ||
+ | #include "really_anyscript" | ||
</code> | </code> | ||