02DE

From GTAMods Wiki
Revision as of 08:19, 4 February 2015 by Spaceeinstein (talk | contribs) (Created page with "__NOTOC__{{Icon|3}} {{Icon|VC}} '''IS_PLAYER_IN_TAXI''' <hr /> '''Description''' : Checks if the player is in a taxi '''Syntax''' : 02DE:   player [''player handle''] dri...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

GTA III Vice City IS_PLAYER_IN_TAXI


Description

Checks if the player is in a taxi

Syntax

02DE:   player [player handle] driving_taxi_vehicle

Parameter

[player handle]
The handle of the player

This opcode returns true if the player is in a taxi. The game will recognize the following list of vehicles as taxis.

GTA III Vice City
Taxi
Cabbie
Borgnine Zebra Cab
Kaufman Cab

The opcode is unsupported in San Andreas and is superseded by opcode 0602.

Disassembled code

These are disassembled code for this opcode both from v1.0 US.

GTA III

; call subroutine to collect values from input parameters
.text:00446A93                 lea     eax, [edi+10h]
.text:00446A96                 mov     ecx, edi
.text:00446A98                 push    1  ; one parameter to collect
.text:00446A9A                 push    eax
.text:00446A9B                 call    CRunningScript__CollectParameters
; read collected content
.text:00446AA0                 mov     ecx, ds:_opcodeParameter1
.text:00446AA6                 xor     al, al
.text:00446AA8                 imul    ecx, 4Fh
.text:00446AAB                 mov     esi, ds:_playerInfo[ecx*4]  ; address of the player
.text:00446AB2                 cmp     byte ptr [esi+314h], 0  ; offset 0x314 to check whether or not the player is in car
.text:00446AB9                 jz      short loc_446ADC
.text:00446ABB                 mov     edx, [esi+310h]  ; offset 0x310 to get pointer of last entered car
.text:00446AC1                 movsx   ebx, word ptr [edx+5Ch]  ; offset 0x5C from car pointer to get the model of the car
.text:00446AC5                 cmp     ebx, 6Eh  ; 110, Taxi
.text:00446AC8                 jz      short loc_446ADA
.text:00446ACA                 cmp     ebx, 80h  ; 128, Cabbie
.text:00446AD0                 jz      short loc_446ADA
.text:00446AD2                 cmp     ebx, 94h  ; 148, Borgnine
.text:00446AD8                 jnz     short loc_446ADC
.text:00446ADA loc_446ADA:     mov     al, 1  ; set compare flag to true
; call subroutine to update compare flag true or false
.text:00446ADC loc_446ADC:     mov     ecx, edi
.text:00446ADE                 push    eax
.text:00446ADF                 call    CRunningScript__UpdateCompareFlag
; end
.text:00446AE4                 xor     al, al
.text:00446AE6                 add     esp, 210h
.text:00446AEC                 pop     ebp
.text:00446AED                 pop     edi
.text:00446AEE                 pop     esi
.text:00446AEF                 pop     ebx
.text:00446AF0                 retn    4

Vice City

; call subroutine to collect values from input parameters
.text:0045600E                 lea     eax, [ebp+10h]
.text:00456011                 mov     ecx, ebp
.text:00456013                 push    1  ; one parameter to collect
.text:00456015                 push    eax
.text:00456016                 call    CRunningScript__CollectParameters
; read collected content
.text:0045601B                 mov     ecx, ds:_opcodeParameter1
.text:00456021                 xor     al, al
.text:00456023                 imul    ecx, 2Eh
.text:00456026                 mov     ebx, ds:_playerInfo[ecx*8]  ; address of the player
.text:0045602D                 cmp     byte ptr [ebx+3ACh], 0  ; offset 0x3AC to check whether or not the player is in car
.text:00456034                 jz      short loc_456066
.text:00456036                 mov     edx, [ebx+3A8h]  ; offset 0x3A8 to get pointer of last entered car
.text:0045603C                 test    edx, edx
.text:0045603E                 jz      short loc_456066
.text:00456040                 movsx   edi, word ptr [edx+5Ch]  ; offset 0x5C from car pointer to get the model of the car
.text:00456044                 cmp     edi, 96h  ; 150, Taxi
.text:0045604A                 jz      short loc_456064
.text:0045604C                 cmp     edi, 0A8h  ; 168, Cabbie
.text:00456052                 jz      short loc_456064
.text:00456054                 cmp     edi, 0BCh  ; 188, Zebra Cab
.text:0045605A                 jz      short loc_456064
.text:0045605C                 cmp     edi, 0D8h  ; 216, Kaufman Cab
.text:00456062                 jnz     short loc_456066
.text:00456064 loc_456064:     mov     al, 1  ; set compare flag to true
; call subroutine to update compare flag true or false
.text:00456066 loc_456066:     mov     ecx, ebp
.text:00456068                 push    eax
.text:00456069                 call    CRunningScript__UpdateCompareFlag
; end
.text:0045606E                 xor     al, al
.text:00456070                 add     esp, 1A8h
.text:00456076                 pop     ebp
.text:00456077                 pop     edi
.text:00456078                 pop     esi
.text:00456079                 pop     ebx
.text:0045607A                 retn    4

Keywords

check, player, driving, taxi