Skip to content

Instantly share code, notes, and snippets.

@LuxXx
Created February 14, 2017 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LuxXx/185b03010f3e0af3fda1123f930a481e to your computer and use it in GitHub Desktop.
Save LuxXx/185b03010f3e0af3fda1123f930a481e to your computer and use it in GitHub Desktop.
Set Time for SAMP AHK
; 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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment