0501
Description
- Sets the player's ability to perform a drive by
Syntax
- 0501: set_player [player handle] drive_by_mode_enabled [int]
Parameter
- [player handle]
- [int]
- 0 = disable, 1 = enable (default)
Native analog
This opcode sets the player's ability to perform drive-bys (shooting out of vehicles). The value set with this opcode is saved in block 18 of the save file 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:006320D0 lea eax, [ebp+10h]
.text:006320D3 mov ecx, ebp
.text:006320D5 push 2 ; two parameters to collect
.text:006320D7 push eax
.text:006320D8 call CRunningScript__CollectParameters
; read collected content
.text:006320DD mov eax, ds:_opcodeParameter1
.text:006320E2 imul eax, 170h
.text:006320E8 add eax, offset _playerInfo ; address of the player info
.text:006320ED cmp ds:_opcodeParameter2, 0 ; check whether or not parameter 2 is set to 0
.text:006320F4 jz short loc_632100
.text:006320F6 mov byte ptr [eax+147h], 1 ; offset 0x147 set to enable drive by
.text:006320FD jmp short loc_632107
.text:006320FF align 10h
.text:00632100 loc_632100: mov byte ptr [eax+147h], 0 ; offset 0x147 set to disable drive by
; end
.text:00632107 loc_632107: xor al, al
.text:00632109 add esp, 1B0h
.text:0063210F pop ebp
.text:00632110 pop edi
.text:00632111 pop esi
.text:00632112 pop ebx
.text:00632113 retn 4
Keywords
set, toggle, player, drive-by, driveby