Difference between revisions of "0135"

From GTAMods Wiki
Jump to navigation Jump to search
m
(disassembly)
 
Line 11: Line 11:
  
 
This opcode behaves exactly as opcode [[020A]].
 
This opcode behaves exactly as opcode [[020A]].
 +
 +
== Disassembled code ==
 +
This is disassembled code for this opcode from PC v1.0 US.
 +
<syntaxhighlight lang="nasm">
 +
loc_43ED92:
 +
    lea    eax, [ebp+10h]                    ; get address of script's current instruction pointer
 +
    mov    ecx, ebp                          ; get address of script for thiscall
 +
    push    2                                ; push 2 for two parameters to collect
 +
    push    eax                              ; push address of script's current instruction pointer
 +
    call    CRunningScript::CollectParameters ; call CRunningScript::CollectParameters(uint *,short)
 +
    mov    eax, ds:ScriptParams[0]          ; get value of first parameter, the vehicle handle
 +
    mov    ecx, ds:CPools::ms_pVehiclePool  ; get address of vehicle pool for thiscall
 +
    push    eax                              ; push vehicle handle
 +
    call    CPool_CVehicle_CAutomobile::GetAt ; call CPool<CVehicle, CAutomobile>::GetAt(int) to get address of vehicle
 +
    mov    ebx, ds:ScriptParams[1]          ; get value of second parameter, the car lock
 +
    mov    [eax+224h], ebx                  ; offset vehicle address by 0x224 and set its car lock
 +
    xor    al, al                            ; return 0
 +
</syntaxhighlight>
  
 
== Keywords ==
 
== Keywords ==
 
set, car, vehicle, door, lock, status
 
set, car, vehicle, door, lock, status

Latest revision as of 23:40, 20 January 2017

GTA III CHANGE_CAR_LOCK


Description
Sets the door lock status of the vehicle
Syntax
0135: [int] = car [car handle] door_status
Parameter
[car handle]
The handle of the vehicle
[int]
Car lock

This opcode behaves exactly as opcode 020A.

Disassembled code

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

loc_43ED92:
    lea     eax, [ebp+10h]                    ; get address of script's current instruction pointer
    mov     ecx, ebp                          ; get address of script for thiscall
    push    2                                 ; push 2 for two parameters to collect
    push    eax                               ; push address of script's current instruction pointer
    call    CRunningScript::CollectParameters ; call CRunningScript::CollectParameters(uint *,short)
    mov     eax, ds:ScriptParams[0]           ; get value of first parameter, the vehicle handle
    mov     ecx, ds:CPools::ms_pVehiclePool   ; get address of vehicle pool for thiscall
    push    eax                               ; push vehicle handle
    call    CPool_CVehicle_CAutomobile::GetAt ; call CPool<CVehicle, CAutomobile>::GetAt(int) to get address of vehicle
    mov     ebx, ds:ScriptParams[1]           ; get value of second parameter, the car lock
    mov     [eax+224h], ebx                   ; offset vehicle address by 0x224 and set its car lock
    xor     al, al                            ; return 0

Keywords

set, car, vehicle, door, lock, status