CLEO HELP Actor's Tip of the Gun XYZ Position

ajom

Well-Known Member
Joined
Apr 14, 2020
Messages
150
Likes
72
Points
28
Location
Pluto
#1
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 [email protected] _returnXYZCoord [email protected] [email protected] [email protected]
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

Well-Known Member
Joined
Jan 2, 2017
Messages
2,229
Likes
420
Points
113
Location
Lithuania
Website
ugbase.eu
20
#2
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 [email protected] = get_hook_param PARAM_PACKETID
IF [email protected] == FALSE
THEN
    IF [email protected] == PACKET_BULLET_SYNC // ID - 224
    THEN
        0BE5: [email protected] = get_hook_param PARAM_BITSTREAM
        0AC8: [email protected] = allocate_memory_size 40
        0BE8: bit_stream [email protected] read_array [email protected] size 40
      
        //float fBullFrom[3]; +3
        0C0C: [email protected] = struct [email protected] offset 4 size 4
        0C0C: [email protected] = struct [email protected] offset 8 size 4
        0C0C: [email protected] = struct [email protected] offset 12 size 4
        chatmsg "From: %f %f %f" -1 [email protected] [email protected] [email protected]
       
        //float fBullTo[3]; +15
        0C0C: [email protected] = struct [email protected] offset 16 size 4
        0C0C: [email protected] = struct [email protected] offset 20 size 4
        0C0C: [email protected] = struct [email protected] offset 24 size 4
        chatmsg "To: %f %f %f" -1 [email protected] [email protected] [email protected]
      
        //BYTE bHitType; +0
        0C0C: [email protected] = struct [email protected] offset 1 size 1
        chatmsg "HitType: %d" -1 [email protected]
      
        //short iHitID; +1
        0C0C: [email protected] = struct [email protected] offset 2 size 2
        chatmsg "HitID: %d" -1 [email protected]
      
        //float fBodyOfsset[3]; +27
        0C0C: [email protected] = struct [email protected] offset 28 size 4
        0C0C: [email protected] = struct [email protected] offset 32 size 4
        0C0C: [email protected] = struct [email protected] offset 36 size 4
        chatmsg "BodyOfsset: %f %f %f" -1 [email protected] [email protected] [email protected]
      
        0BEA: raknet bit_stream [email protected] reset_write_pointer
        0B40: raknet bit_stream [email protected] write [email protected] type BS_TYPE_ARRAY size 40      
        0AC9: free_allocated_memory [email protected]   
    END
END
0BE0: hook_ret TRUE
 
Last edited:
OP
OP
A

ajom

Well-Known Member
Joined
Apr 14, 2020
Messages
150
Likes
72
Points
28
Location
Pluto
#3
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 [email protected] = get_hook_param PARAM_PACKETID
IF [email protected] == FALSE
THEN
    IF [email protected] == PACKET_BULLET_SYNC // ID - 224
    THEN
        0BE5: [email protected] = get_hook_param PARAM_BITSTREAM
        0AC8: [email protected] = allocate_memory_size 40
        0BE8: bit_stream [email protected] read_array [email protected] size 40
      
        //float fBullFrom[3]; +3
        0C0C: [email protected] = struct [email protected] offset 4 size 4
        0C0C: [email protected] = struct [email protected] offset 8 size 4
        0C0C: [email protected] = struct [email protected] offset 12 size 4
        chatmsg "From: %f %f %f" -1 [email protected] [email protected] [email protected]
       
        //float fBullTo[3]; +15
        0C0C: [email protected] = struct [email protected] offset 16 size 4
        0C0C: [email protected] = struct [email protected] offset 20 size 4
        0C0C: [email protected] = struct [email protected] offset 24 size 4
        chatmsg "To: %f %f %f" -1 [email protected] [email protected] [email protected]
      
        //BYTE bHitType; +0
        0C0C: [email protected] = struct [email protected] offset 1 size 1
        chatmsg "HitType: %d" -1 [email protected]
      
        //short iHitID; +1
        0C0C: [email protected] = struct [email protected] offset 2 size 2
        chatmsg "HitID: %d" -1 [email protected]
      
        //float fBodyOfsset[3]; +27
        0C0C: [email protected] = struct [email protected] offset 28 size 4
        0C0C: [email protected] = struct [email protected] offset 32 size 4
        0C0C: [email protected] = struct [email protected] offset 36 size 4
        chatmsg "BodyOfsset: %f %f %f" -1 [email protected] [email protected] [email protected]
      
        0BEA: raknet bit_stream [email protected] reset_write_pointer
        0B40: raknet bit_stream [email protected] write [email protected] type BS_TYPE_ARRAY size 40      
        0AC9: free_allocated_memory [email protected]   
    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

Well-Known Member
Joined
Oct 1, 2019
Messages
54
Likes
24
Points
13
Location
Uganda
#5
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
 
OP
OP
A

ajom

Well-Known Member
Joined
Apr 14, 2020
Messages
150
Likes
72
Points
28
Location
Pluto
#6
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
 
Top