Difference between revisions of "0135"

From GTAMods Wiki
Jump to navigation Jump to search
(updating page)
(disassembly)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Icon|3}} '''CHANGE_CAR_LOCK'''
+
{{OpCode
<hr />
+
| games      = {{Icon|3}}
<onlyinclude>{{#ifeq:{{{transcludesection|opcode}}}|opcode|
+
| command    = CHANGE_CAR_LOCK
'''Description'''
+
| description = Sets the door lock status of the vehicle
: Sets the door lock status of the vehicle
+
| syntax1    = 0135: [''int''] = car [''car handle''] door_status
'''Syntax'''
+
| p1t        = [''car handle'']
: 0135: [''int''] = car [''car handle''] door_status
+
| p1d        = The handle of the vehicle
'''Parameter'''
+
| p2t        = [''int'']
: [''int'']
+
| p2d        = [[020A#Car locks|Car lock]]
:: Lock status
+
}}
: [''car handle'']
 
:: The handle of the vehicle
 
  
 
This opcode behaves exactly as opcode [[020A]].
 
This opcode behaves exactly as opcode [[020A]].
}}</onlyinclude>
+
 
 +
== 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
 
[[Category:OpCodes]]
 

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