Difference between revisions of "0135"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with '{{OpCode | ini = 0135=2,%2d% %1d% | description = Sets the door lock status | p1 = Valid vehicle handle | p2 = Integer | game = GTA 3 }} This…')
 
(disassembly)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 0135=2,%2d% %1d%
+
| games      = {{Icon|3}}
| description = Sets the door lock status
+
| command    = CHANGE_CAR_LOCK
| p1          = Valid vehicle handle
+
| description = Sets the door lock status of the vehicle
| p2          = Integer
+
| syntax1    = 0135: [''int''] = car [''car handle''] door_status
| game        = [[GTA 3]]
+
| p1t        = [''car handle'']
 +
| p1d        = The handle of the vehicle
 +
| p2t        = [''int'']
 +
| p2d        = [[020A#Car locks|Car lock]]
 
}}
 
}}
 +
 
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 ==
 +
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