0AB2

From GTAMods Wiki
Jump to navigation Jump to search
For CLEO for GTA III and Vice City prior to v2.0.0.0, use opcode 05F6.

GTA III Vice City San Andreas (with CLEO)


Description

Returns from a scm function

Syntax

0AB2: ret [int] ( [any] … )

Parameter

[int]
Number of values to return
[any]
Returned values if there are ones (optional), up to 30

This opcode transfers the thread execution back to 0AB1 opcode and stores the returned values in its variables. Total number of returned values must be equal to the number of variables storing the result in 0AB1. If the 0AB2 opcode does not return any values, it must have a 0 as the only parameter, and proper 0AB1 that calls such a function should have no variables to store.

In this example 0AB2 returns only one value, which is the value of variable 0@, this value will be copied to the variable $result.

Keywords

CLEO, scm function, return, ret