CLEO Help Actor's Tip of the Gun XYZ Position

CLEO related
Status
Not open for further replies.

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Hello, I am trying to get the xyz position of the Gun Muzzle(where the bullet is coming from) of a certain actor. But it seems that I can't find any sources around the internet that fixes this problem, I will appreciate if anybody know a memory pointer, snippet, script demo that gets the XYZ Position of the Gun's Tip, it does not matter if it is a "world XYZ coordinate" or an "actor relative offset". Maybe something like:
Code:
0AB1: @GetGunMuzzleCoord 1 _ofactor 0@ _returnXYZCoord 29@ 30@ 31@

I tried reading the weapon.dat inside the memory:
  • + 0x24 = [dword] fireOffset.x
  • + 0x28 = [dword] fireOffset.y
  • + 0x2C = [dword] fireOffset.z
The value never changes.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Gta memories worked only for snipper, idk why...

You can try use this to find gta memories:
PHP:
{$CLEO .cs}
{$INCLUDE SF}

0000:

REPEAT
    WAIT 0
UNTIL 0AFA:

0BE2: setup_outcoming_packet_hook @Hooks

WHILE TRUE
WAIT 0                   
END

:Hooks
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
IF 0@ == FALSE
THEN
    IF 31@ == PACKET_BULLET_SYNC // ID - 224
    THEN
        0BE5: 30@ = get_hook_param PARAM_BITSTREAM
        0AC8: 29@ = allocate_memory_size 40
        0BE8: bit_stream 30@ read_array 29@ size 40
      
        //float fBullFrom[3]; +3
        0C0C: 28@ = struct 29@ offset 4 size 4
        0C0C: 27@ = struct 29@ offset 8 size 4
        0C0C: 26@ = struct 29@ offset 12 size 4
        chatmsg "From: %f %f %f" -1 28@ 27@ 26@
       
        //float fBullTo[3]; +15
        0C0C: 25@ = struct 29@ offset 16 size 4
        0C0C: 24@ = struct 29@ offset 20 size 4
        0C0C: 23@ = struct 29@ offset 24 size 4
        chatmsg "To: %f %f %f" -1 25@ 24@ 23@
      
        //BYTE bHitType; +0
        0C0C: 22@ = struct 29@ offset 1 size 1
        chatmsg "HitType: %d" -1 22@
      
        //short iHitID; +1
        0C0C: 21@ = struct 29@ offset 2 size 2
        chatmsg "HitID: %d" -1 21@
      
        //float fBodyOfsset[3]; +27
        0C0C: 20@ = struct 29@ offset 28 size 4
        0C0C: 19@ = struct 29@ offset 32 size 4
        0C0C: 18@ = struct 29@ offset 36 size 4
        chatmsg "BodyOfsset: %f %f %f" -1 20@ 19@ 18@
      
        0BEA: raknet bit_stream 30@ reset_write_pointer
        0B40: raknet bit_stream 30@ write 29@ type BS_TYPE_ARRAY size 40      
        0AC9: free_allocated_memory 29@   
    END
END
0BE0: hook_ret TRUE
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Gta memories worked only for snipper, idk why...

You can try use this to find gta memories:
PHP:
{$CLEO .cs}
{$INCLUDE SF}

0000:

REPEAT
    WAIT 0
UNTIL 0AFA:

0BE2: setup_outcoming_packet_hook @Hooks

WHILE TRUE
WAIT 0                   
END

:Hooks
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
IF 20@ == FALSE
THEN
    IF 31@ == PACKET_BULLET_SYNC // ID - 224
    THEN
        0BE5: 30@ = get_hook_param PARAM_BITSTREAM
        0AC8: 29@ = allocate_memory_size 40
        0BE8: bit_stream 30@ read_array 29@ size 40
      
        //float fBullFrom[3]; +3
        0C0C: 28@ = struct 29@ offset 4 size 4
        0C0C: 27@ = struct 29@ offset 8 size 4
        0C0C: 26@ = struct 29@ offset 12 size 4
        chatmsg "From: %f %f %f" -1 28@ 27@ 26@
       
        //float fBullTo[3]; +15
        0C0C: 25@ = struct 29@ offset 16 size 4
        0C0C: 24@ = struct 29@ offset 20 size 4
        0C0C: 23@ = struct 29@ offset 24 size 4
        chatmsg "To: %f %f %f" -1 25@ 24@ 23@
      
        //BYTE bHitType; +0
        0C0C: 22@ = struct 29@ offset 1 size 1
        chatmsg "HitType: %d" -1 22@
      
        //short iHitID; +1
        0C0C: 21@ = struct 29@ offset 2 size 2
        chatmsg "HitID: %d" -1 21@
      
        //float fBodyOfsset[3]; +27
        0C0C: 20@ = struct 29@ offset 28 size 4
        0C0C: 19@ = struct 29@ offset 32 size 4
        0C0C: 18@ = struct 29@ offset 36 size 4
        chatmsg "BodyOfsset: %f %f %f" -1 20@ 19@ 18@
      
        0BEA: raknet bit_stream 30@ reset_write_pointer
        0B40: raknet bit_stream 30@ write 29@ type BS_TYPE_ARRAY size 40      
        0AC9: free_allocated_memory 29@   
    END
END
0BE0: hook_ret TRUE

Thank you. But that will only work if the player fires it's weapon. I am trying to monitor the position of a certain actor gun's tip all the time even when he is idle,aiming,firing.
 

88resu

Active member
Joined
Oct 1, 2019
Messages
110
Reaction score
46
Location
Uganda
let me guess laser pointer mod. (or esp from aim angles of enemys isnt a dumb idea xD ) i will look into it
stAimData mb

u can also read the animation, get the angle of the player lookin at
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
let me guess laser pointer mod. (or esp from aim angles of enemys isnt a dumb idea xD ) i will look into it
stAimData mb

u can also read the animation, get the angle of the player lookin at

I read about laser aim mod made by Wesser, it was a good script demo, but the laser source was attached at bone 25(left hand), I was just hoping if there are any memory pointers that get the XYZ POS of the gun tip instead of using the left hand of the actor as origin of the laser.

But so far if there can be no memory pointers, I might try to give individual gun's a certain offset respect to bone 25 to act as gun's tip. I will make an update after I finish
 
Status
Not open for further replies.
Top