Difference between revisions of "004F"
Line 14: | Line 14: | ||
... | ... | ||
... | ... | ||
+ | :SAVEGAME | ||
03A4: name_thread 'SAVE' | 03A4: name_thread 'SAVE' | ||
00D6: if 0 | 00D6: if 0 |
Revision as of 11:58, 13 May 2007
004F=-1,%1p%
Description: Creates a new thread
Parameter 1: Label
+extra parameters
Supports: GTA3, Vice City, San Andreas
This opcode creates a new thread. It begins an execution from the place marked by the label passed as the parameter.
The distinctive feature of this opcode is that it has various number of the parameters. The first parameter (a label) must be always, extra parameters depends on the scripter needs. The aim of using of the extra parameters is to set the values of the local variables of the created thread. The first extra parameter (the second in the opcode) sets the value for the variable 0@, the second extra parameters set the one for 1@ and so on. Total possible number of extra parameters depends on the local variables number for the game: 16+2 for GTA3 and VC, 32+2 for SA.
Example
$VAR = 10 004F: create_thread @SAVEGAME 10 $VAR ... ... :SAVEGAME 03A4: name_thread 'SAVE' 00D6: if 0 003B: 0@ == 1@ 004D: jump_if_false @EXIT 0109: player $PLAYER_CHAR money += 0@ :EXIT 004E: end_thread
When the game will execute this code, the player get 10 buxes.
Keywords
thread, create