Difference between revisions of "0002"

From GTAMods Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{Icon|trilogy}} '''GOTO'''
+
{{Icon|t}} '''GOTO'''
 
<hr />
 
<hr />
 
'''Description'''
 
'''Description'''
Line 10: Line 10:
 
:: The position in the script it will go to, usually identified by a [[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.
+
This opcode 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 ==
 
== Example ==
Line 34: Line 34:
 
== Keywords ==
 
== Keywords ==
 
jump, goto, label
 
jump, goto, label
 +
 +
== See also ==
 +
* {{Icon|t}} [[004D]], goto if false
  
 
[[Category:OpCodes]]
 
[[Category:OpCodes]]

Revision as of 20:47, 31 December 2015

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 opcode 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

See also

  • GTA III Vice City San Andreas 004D, goto if false