[SNIPPET] Send KeyPress via Gta

Opcode.eXe

Well-Known Member
Joined
Feb 18, 2013
Messages
1,280
Likes
30
Points
98
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
10
#1
Code:
0AB1: @FAKE_KEYPRESS 1 _OFFSET_KEY_ 0x3 {W}



 
:FAKE_KEYPRESS
[email protected] = 0xB73458 
005A: [email protected] += [email protected]  // (int)
0A8C: write_memory [email protected] size 1 value 255 virtual_protect 0
0AB2: ret 0

{
Offset	    Slot 	
+ 0x0		Right						
+ 0x1		Left							
+ 0x2		Backwards					
+ 0x3		Forward						
+ 0x4		Look right					
+ 0x5		Look left					
+ 0x6		Look down						
+ 0x7		Look up							
+ 0x8		Action			
+ 0xA		Previous weapon/target				
+ 0xC		Aim weapon					
+ 0xE		Next weapon/target				
+ 0x10		Group CTRL forward					
+ 0x12		Group CTRL back						
+ 0x14		Conversation - NO					
+ 0x16		Conversation - YES					
+ 0x1A		Change camera					
+ 0x1C		Jump							
+ 0x1E		Enter+exit						
+ 0x20		Sprint							
+ 0x22		Fire							
+ 0x24		Crouch							
+ 0x26		Look behind						
+ 0x28		Unused							
+ 0x2A		Walk							
}
 

Zin

Well-Known Member
Joined
Aug 1, 2013
Messages
1,269
Likes
0
Points
86
Website
youtube.com
#3
Re: Send KeyPress via Gta

The forward one does not make cars accelerate. Im trying to make an auto driver cleo mod but i need the car to actually go forward.
 

springfield

Well-Known Member
Staff member
Joined
Feb 18, 2005
Messages
2,935
Likes
17
Points
88
Website
www.ugbase.eu
#4
Re: Send KeyPress via Gta

For vehicle they're different.
http://gtaforums.com/topic/194199-documenting-gta-sa-memory-addresses/?p=1059674630
 

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
703
Likes
6
Points
23
Location
Lithuania
Website
ugbase.eu
#7
Vehicle control alternative w/o opcode 0B56

Code:
0AB1: call_scm_func @PressTurningKey 1 set_game_key_0_state -255 // PRESS LEFT
0AB1: call_scm_func @PressTurningKey 1 set_game_key_0_state 255  // PRESS RIGHT
0AB1: call_scm_func @PressTurningKey 1 set_game_key_0_state 0    // UNPRESS RIGHT
0AB1: call_scm_func @PressBrake 1 set_game_key_6_state 255 // PRESS BRAKE
0AB1: call_scm_func @PressBrake 1 set_game_key_6_state 0   // UNPRESS BRAKE
Snippets.:
Code:
:PressTurningKey
IF
[email protected] == -255
THEN // PRESS LEFT
    0006: [email protected] = 0xB73458
    000A: [email protected] += 0x1
    0A8C: write_memory [email protected] size 1 value 128 virtual_protect 0
ELSE
    IF
    [email protected] == 255 
    THEN // PRESS RIGHT
        0006: [email protected] = 0xB73458
        000A: [email protected] += 0x0
        0A8C: write_memory [email protected] size 1 value 128 virtual_protect 0
    ELSE
        IF
        [email protected] == 0
        THEN // UNPRESS RIGHT
            0006: [email protected] = 0xB73458
            000A: [email protected] += 0x0
            0A8C: write_memory [email protected] size 1 value 0 virtual_protect 0
        END
    END
END
0AB2: ret 0

:PressBrake
IF
[email protected] == 255
THEN // PRESS BRAKE
    0006: [email protected] = 0xB73458
    000A: [email protected] += 0x1C
    0A8C: write_memory [email protected] size 1 value 255 virtual_protect 0
ELSE
    IF
    [email protected] == 0 
    THEN // NOT PRESS BRAKE
        0006: [email protected] = 0xB73458
        000A: [email protected] += 0x8
        0A8C: write_memory [email protected] size 1 value 0 virtual_protect 0
    END
END
0AB2: ret 0
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
239
Likes
2
Points
33
Location
Romania
#8
Vehicle control alternative w/o opcode 0B56

Code:
0AB1: call_scm_func @PressTurningKey 1 set_game_key_0_state -255 // PRESS LEFT
0AB1: call_scm_func @PressTurningKey 1 set_game_key_0_state 255  // PRESS RIGHT
0AB1: call_scm_func @PressTurningKey 1 set_game_key_0_state 0    // UNPRESS RIGHT
0AB1: call_scm_func @PressBrake 1 set_game_key_6_state 255 // PRESS BRAKE
0AB1: call_scm_func @PressBrake 1 set_game_key_6_state 0   // UNPRESS BRAKE
Snippets.:
Code:
:PressTurningKey
IF
[email protected] == -255
THEN // PRESS LEFT
    0006: [email protected] = 0xB73458
    000A: [email protected] += 0x1
    0A8C: write_memory [email protected] size 1 value 128 virtual_protect 0
ELSE
    IF
    [email protected] == 255
    THEN // PRESS RIGHT
        0006: [email protected] = 0xB73458
        000A: [email protected] += 0x0
        0A8C: write_memory [email protected] size 1 value 128 virtual_protect 0
    ELSE
        IF
        [email protected] == 0
        THEN // UNPRESS RIGHT
            0006: [email protected] = 0xB73458
            000A: [email protected] += 0x0
            0A8C: write_memory [email protected] size 1 value 0 virtual_protect 0
        END
    END
END
0AB2: ret 0

:PressBrake
IF
[email protected] == 255
THEN // PRESS BRAKE
    0006: [email protected] = 0xB73458
    000A: [email protected] += 0x1C
    0A8C: write_memory [email protected] size 1 value 255 virtual_protect 0
ELSE
    IF
    [email protected] == 0
    THEN // NOT PRESS BRAKE
        0006: [email protected] = 0xB73458
        000A: [email protected] += 0x8
        0A8C: write_memory [email protected] size 1 value 0 virtual_protect 0
    END
END
0AB2: ret 0
since your call func have first var w/ only two options 255 and 0,why you used again if [email protected]==0... if the first cond is false?(if [email protected]=255)
 
Top