AHK SAMP UdfEx (0.3.7)

notgood

Well-Known Member
Joined
Feb 3, 2017
Messages
46
Likes
0
Points
21
How do I get the x, y, z or player id of the nearest target from my mouse position?
ex) GetNearestMouseTarget()
 

luxdav

Active Member
Joined
Sep 17, 2014
Messages
44
Likes
2
Points
58
notgood said:
How do I get the x, y, z or player id of the nearest target from my mouse position?
ex) GetNearestMouseTarget()
Hi. After two years doing nothing for SAMP I looked into SAMP 0.3.7 R2.
I already made something similiar for vehicle, actors, players and objects. It draws the targetedId at the model:

https://cdn.discordapp.com/attachments/446661895374503938/448828569016205312/sa-mp-047.png
https://media.discordapp.net/attachments/446661895374503938/448823013094195200/sa-mp-044.png?width=1214&height=683
https://cdn.discordapp.com/attachments/446661895374503938/448823011072671754/sa-mp-046.png
https://media.discordapp.net/attachments/446661895374503938/448823008228933652/sa-mp-045.png

@dope
Im also thinking about a better getChatLine function. But when you're alt tabbed the game stops even a better getChatLine wont work if you're on desktop.
 

luxdav

Active Member
Joined
Sep 17, 2014
Messages
44
Likes
2
Points
58
dope said:
add GetChatLine_func := DllCall("GetProcAddress", UInt, hModule, Str, "GetChatLine") please
I found this somewhere:

Code:
getChatLineEx(line := 0) {
    ; 0x152 - offset for first message
    ; 0xFC - size of a message
    ; 99 - max count of a messages
    if(!checkHandles())
        return
    dwPtr := dwSAMP + ADDR_SAMP_CHATMSG_PTR
    dwAddress := readDWORD(hGTA, dwPtr)
    if(ErrorLevel)
        return
    msg := readString(hGTA, dwAddress + 0x152 + ( (99-line) * 0xFC), 0xFC)
    if(ErrorLevel)
        return
    return msg
}

 

luxdav

Active Member
Joined
Sep 17, 2014
Messages
44
Likes
2
Points
58
notgood said:
How do I get the x, y, z or player id of the nearest target from my mouse position?
ex) GetNearestMouseTarget()
I'm currently playing around with this.
https://www.youtube.com/watch?v=QmDfY_c4Mj4
 
Top