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)
}
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")
}
}
}
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?
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]
}
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
0665: get_actor $PLAYER_ACTOR model_to $SKINID
getPlayerSkinId()
Dude, here are my functions:Ghost29 link said:Can someone tell or write function to change ingame time?
; 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)
}
; 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
}
esb link said:is there an offset to get the player's skin, similar to
if so, can you make this functionCode:0665: get_actor $PLAYER_ACTOR model_to $SKINID
i desperately need this to make my ahk script much more powerfulCode:getPlayerSkinId()
; 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
}
:celeral_spitting:luxdav link said:Hoi!
This works for me:
Greets luxdavCode:; 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 }
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
}