0330

From GTAMods Wiki
Revision as of 17:43, 16 April 2015 by Spaceeinstein (talk | contribs) (disassembly)
Jump to navigation Jump to search

GTA III Vice City San Andreas SET_PLAYER_NEVER_GETS_TIRED


Description

Sets the player to sprint without tiring

Syntax

0330: set_player [player handle] infinite_run_to [int]

Parameter

[player handle]
The handle of the player
[int]
0 = disable (default), 1 = enable

Native analog

SET_PLAYER_NEVER_GETS_TIRED

This opcode sets the player's ability to sprint without tiring out. The value set with this opcode is saved in block 16 of the save file in GTA III, block 18 in Vice City and in block 15 in San Andreas.

Disassembled code

This is disassembled code for this opcode from v1.0 US.

Vice City

; call subroutine to collect values from input parameters
.text:0045B950                 mov     eax, [esp+2D0h+var_2B8]
.text:0045B954                 mov     ecx, [esp+2D0h+var_2B8]
.text:0045B958                 add     eax, 10h
.text:0045B95B                 push    2
.text:0045B95D                 push    eax
.text:0045B95E                 call    CRunningScript__CollectParameters
; read collected content
.text:0045B963                 mov     eax, ds:_opcodeParameter1
.text:0045B968                 imul    eax, 170h
.text:0045B96E                 add     eax, offset _playerInfo  ; address of the player info
.text:0045B973                 cmp     ds:_opcodeParameter2, 0  ; check whether or not parameter 2 is set to 0
.text:0045B97A                 jz      short loc_45B985
.text:0045B97C                 mov     byte ptr [eax+140h], 1  ; offset 0x140 set to enable infinite run
.text:0045B983                 jmp     short loc_45B98C
.text:0045B985 loc_45B985:     mov     byte ptr [eax+140h], 0  ; offset 0x140 set to disable infinite run
.text:0045B98C loc_45B98C:     lea     ecx, [esp+2D0h+var_1B0]
.text:0045B993                 call    CMatrix__~CMatrix
; end
.text:0045B998                 xor     al, al
.text:0045B99A                 add     esp, 2D0h
.text:0045B9A0                 pop     ebp
.text:0045B9A1                 pop     edi
.text:0045B9A2                 pop     esi
.text:0045B9A3                 pop     ebx
.text:0045B9A4                 retn    4

Keywords

set, toggle, infinite, run, sprint