AHK SAMP UdfEx (0.3.7)

capo1337

Member
Joined
Jul 9, 2015
Messages
7
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

Can you tell me how to change the ingame weather (client side) ? It would be really nice!
 

democrazy

Active member
Joined
Aug 4, 2014
Messages
65
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

you just need to change some weather id value in memory
Code:
setweather(i)
{
    i += 0
    i := Floor(i)
    
    if(!checkHandles())
		return
    
    VarSetCapacity(bla, 4)
    NumPut(i, bla, 0, "UInt")
    writeRaw(hGTA, 0xC8131C, &bla, 4)
    writeRaw(hGTA, 0xC81320, &bla, 4)
}
 

PeterL

Member
Joined
Dec 26, 2014
Messages
16
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

How can i get the Skin id from other players?
 

Wantzy

New member
Joined
Jul 11, 2015
Messages
2
Reaction score
1
Re: [AHK] samp UdfEx (0.3.7)

Push

Anyone got some awesome scripts?
 

capo1337

Member
Joined
Jul 9, 2015
Messages
7
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

Is it possible to read other Players Position and To Check if the player is in Range Of XY
Like: if( aplayer == isinRangeOf( x,y,Range )
SendChat("Player XY is in Range of XY") ?
 

democrazy

Active member
Joined
Aug 4, 2014
Messages
65
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

yes capo

Code:
printNearPlayers()
{
	dist := 20
	p := getStreamedInPlayersInfo()		; streamedinplayers array
	if(!p)
		return
	lpos := getCoordinates()	; your position
	if(!lpos)
		return
	For i, o in p
	{
		t:=getDist(lpos,o.POS)
		if(t<=dist)
		{
			addMessageToChatWindow("{FF0000}" o.NAME "{FFFFFF} is in range of " dist "m")
		}
	}
}


[member=32355]PeterL[/member]

i dont know offset for skin id by ped  :sadpepe:
 

Storm

Member
Joined
Jan 22, 2014
Messages
21
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

Oh. Thank you. Now i can much more easly do my radarhack.
Can pls someone tell or write function wich convert 3D position to Screen coordinates in autohotkey?
 

PeterL

Member
Joined
Dec 26, 2014
Messages
16
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

Storm link said:
Oh. Thank you. Now i can much more easly do my radarhack.
Can pls someone tell or write function wich convert 3D position to Screen coordinates in autohotkey?
Code:
calcScreenCoors(fX,fY,fZ)
{
	if(!checkHandles())
		return false
	
	dwM := 0xB6FA2C
	
	m_11 := readFloat(hGTA, dwM + 0*4)
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return false
	}
	
	m_12 := readFloat(hGTA, dwM + 1*4)
	m_13 := readFloat(hGTA, dwM + 2*4)
	m_21 := readFloat(hGTA, dwM + 4*4)
	m_22 := readFloat(hGTA, dwM + 5*4)
	m_23 := readFloat(hGTA, dwM + 6*4)
	m_31 := readFloat(hGTA, dwM + 8*4)
	m_32 := readFloat(hGTA, dwM + 9*4)
	m_33 := readFloat(hGTA, dwM + 10*4)
	m_41 := readFloat(hGTA, dwM + 12*4)
	m_42 := readFloat(hGTA, dwM + 13*4)
	m_43 := readFloat(hGTA, dwM + 14*4)
	
	dwLenX := readDWORD(hGTA, 0xC17044)
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return false
	}
	dwLenY := readDWORD(hGTA, 0xC17048)
	
	frX := fZ * m_31 + fY * m_21 + fX * m_11 + m_41
	frY := fZ * m_32 + fY * m_22 + fX * m_12 + m_42
	frZ := fZ * m_33 + fY * m_23 + fX * m_13 + m_43
	
	fRecip := 1.0/frZ
	frX *= fRecip * dwLenX
	frY *= fRecip * dwLenY
    
    if(frX<=dwLenX && frY<=dwLenY && frZ>1)
        return [frX,frY,frZ]
}
 

ΆλφA

Member
Joined
Oct 20, 2014
Messages
7
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

Can you include that in your API?
0x56BA00 : GetCollisionBetweenPoints(float *vecOrigin, float *vecTarget, float *vecPoint, DWORD *dwEntity, bool bSolid, bool bCar, bool bActor, bool bObject, bool bParticle, bool bIgnoreSeeThroughStuff, bool bIgnoreSomeObjectsForCamera, bool bIgnoreShootThroughStuff)
 

Massakerw0w

New member
Joined
Apr 6, 2015
Messages
3
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

getIdByPed(dwPed) always returning -1.
Is this a bug or something?
 

Ghost29

Member
Joined
Mar 11, 2015
Messages
10
Reaction score
1
Re: [AHK] samp UdfEx (0.3.7)

Can someone tell or write function to change ingame time?
 

Fadeaway

New member
Joined
Apr 27, 2013
Messages
1
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

Is there a chance to mark a fraction with color like green on the map and no one else?
Sorry for my englisch
 

whoonga

Active member
Joined
Nov 6, 2014
Messages
52
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

Fadeaway link said:
Is there a chance to mark a fraction with color like green on the map and no one else?
Sorry for my englisch

Do you mean the map blips on the minimap or what?
 

Rat

Active member
Joined
Sep 24, 2013
Messages
137
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

is there an offset to get the player's skin, similar to
Code:
0665:   get_actor $PLAYER_ACTOR model_to $SKINID
if so, can you make this function
Code:
getPlayerSkinId()
i desperately need this to make my ahk script much more powerful
 

luxdav

Active member
Joined
Sep 17, 2014
Messages
45
Reaction score
5
Re: [AHK] samp UdfEx (0.3.7)

Ghost29 link said:
Can someone tell or write function to change ingame time?
Dude, here are my functions:

Code:
; sets the ingame hour (day/night)
; @author luxdav aka David_Luchs
; @param hour the time between 0 and 23
setTime(hour)
{
	if(!checkHandles())
		return
	; disable gta setTime function
	VarSetCapacity(nop, 6, 0)
	Loop 6 {
		NumPut(0x90,nop,A_INDEX-1,"UChar")
	}
	writeRaw(hGTA, 0x52D168, &nop, 6)

	; set our own weather
	VarSetCapacity(time, 1, 0)
	NumPut(hour, time,0,"Int")
	writeRaw(hGTA, 0xB70153, &time, 1)
}
Code:
; sets the weather
; @author luxdav aka David_Luchs
; @param weather id
; check http://www.gtamodding.com/index.php?title=Memory_Addresses_%28SA%29 for weather codes
setWeather(id)
{
	if(!checkHandles())
		return 
	VarSetCapacity(weather, 1, 0)
	NumPut(id,weather,0,"Int")
	writeRaw(hGTA, 0xC81320, &weather, 1)
	if(ErrorLevel)
		return false


	return true
}
Greets luxdav
 

luxdav

Active member
Joined
Sep 17, 2014
Messages
45
Reaction score
5
Re: [AHK] samp UdfEx (0.3.7)

esb link said:
is there an offset to get the player's skin, similar to
Code:
0665:   get_actor $PLAYER_ACTOR model_to $SKINID
if so, can you make this function
Code:
getPlayerSkinId()
i desperately need this to make my ahk script much more powerful

Hoi!
This works for me:
Code:
; get the id of your skin
; @author luxdav aka David_Luchs
getSkinID() {
	if(!checkHandles())
		return -1

	dwAddress := readDWORD(hGTA, 0xB6F3B8)

	if(ErrorLevel || dwAddress==0) {
		ErrorLevel := ERROR_READ_MEMORY
		return -1
	}

	id := readMem(hGTA, dwAddress + 0x22, 2, "UShort")
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return -1
	}
	ErrorLevel := ERROR_OK
	return id
}
Greets luxdav
 

Rat

Active member
Joined
Sep 24, 2013
Messages
137
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

luxdav link said:
Hoi!
This works for me:
Code:
; get the id of your skin
; @author luxdav aka David_Luchs
getSkinID() {
	if(!checkHandles())
		return -1

	dwAddress := readDWORD(hGTA, 0xB6F3B8)

	if(ErrorLevel || dwAddress==0) {
		ErrorLevel := ERROR_READ_MEMORY
		return -1
	}

	id := readMem(hGTA, dwAddress + 0x22, 1, "Char")
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return -1
	}
	ErrorLevel := ERROR_OK
	return id
}
Greets luxdav
:celeral_spitting:
it works!

the problem though is it can only read the skins properly from 0 to 127.
once i choose a skin from 129 onwards, the value returned will be -128, -127, -126...
:sadpepe:
 

democrazy

Active member
Joined
Aug 4, 2014
Messages
65
Reaction score
0
Re: [AHK] samp UdfEx (0.3.7)

here's my
Code:
getActorModelId()
{
    if(!checkHandles())
        return -1

	dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
    if(ErrorLevel) {
        ErrorLevel := ERROR_READ_MEMORY
        return -1
    }
	
	if(!dwCPedPtr)
		return -1
	
	dwVal := readMem(hGTA, dwCPedPtr + 0x22, 2, "UShort")
    if(ErrorLevel) {
        ErrorLevel := ERROR_READ_MEMORY
        return -1
    }
	
	return dwVal
}
 
Top