0002

From GTAMods Wiki
Revision as of 20:36, 31 December 2015 by Spaceeinstein (talk | contribs)
Jump to navigation Jump to search

GTA III Vice City San Andreas GOTO


Description

Jumps to a label in the script.

Syntax

0002: jump [label]
jump [label]

Parameters

[label]
The position in the script it will go to, usually identified by a label

This is used in unconditional jumps. In both the Mission Builder and Sanny Builder, you can use the jump keyword instead. The destination point is identified by a label, which is then used as a parameter.

Example

The following example, using Sanny Builder, shows a simple usage of a "jump" out of a while loop to a specified label after the CAMERA key is pressed. The message will change from 0 to 1 after a successful jump.

while true
    wait 10 ms
    01E5: text_1number_highpriority 'NUMBER' 0 10 ms 1
    if 
        00E1:   key_pressed 0 13  // camera key
    then
        jump @label_goto
    end
end

:label_misc
// miscellaneous content

:label_goto
01E5: text_1number_highpriority 'NUMBER' 1 5000 ms 1

Keywords

jump, goto, label