-
Notifications
You must be signed in to change notification settings - Fork 757
Callsub
Haru edited this page Oct 19, 2016
·
1 revision
- callsub <label></label>{,<argument></argument>,...<argument></argument>};
This command will go to a specified label within the current script (do NOT use quotes around it) coming in as if it were a 'callfunc' call, and pass it arguments given, if any, which can be recovered there with 'getarg'. When done there, you should use the 'return' command to go back to the point from where this label was called. This is used when there is a specific thing the script will do over and over, this lets you use the same bit of code as many times as you like, to save space and time, without creating extra NPC objects which are needed with 'callfunc'. A label is not callable in this manner from another script.
mes &amp;quot&#59;&amp;&#35;91&#59;Woman&amp;&#35;93&#59;&amp;quot&#59;&amp;&#35;59&#59; mes &amp;quot&#59;Lets see if you win&amp;quot&#59;&amp;&#35;59&#59; callsub Check,2&amp;&#35;59&#59; mes &amp;quot&#59;Well done you have won&amp;quot&#59;&amp;&#35;59&#59; close&amp;&#35;59&#59; Check&amp;&#35;58&#59; if(&amp;&#35;33&#59;rand(getarg(0))) return&amp;&#35;59&#59; mes &amp;quot&#59;Sorry you lost&amp;quot&#59;&amp;&#35;59&#59; close&amp;&#35;59&#59;