AHK SAMP UdfEx (0.3.7)

notgood

Active member
Joined
Feb 3, 2017
Messages
49
Reaction score
0
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
45
Reaction score
5
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:

sa-mp-047.png

sa-mp-044.png

sa-mp-046.png

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
45
Reaction score
5
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
}


Suicide Bomb said:
Is it possible to register client side commands in AHK?

You can register commands by using this function:


Code:
samp.dll+65BA0: void __thiscall registerCommand(int this, const char *commandName, int func)

The most used this object is: samp.dll+21A0F0


Ghost29 said:
Hello everyone, i need your help, can someone write/find a function that can take screenshots in game? And there is one problem, gdip + ahk doesn't work, it saves black screen or desktop. I really need this function! Thanks.

How about setting the screenshotFlag to 1 in SAMP? (It's a dword)

samp.dll+119CBC

All these offsets are for 0.3.7 R2.


You could also call the takeScreenshot function of SAMP manually . It's at samp.dll+71060 (0.3.7 R2)
 

luxdav

Active member
Joined
Sep 17, 2014
Messages
45
Reaction score
5
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