Created
January 17, 2017 18:41
-
-
Save khorevaa/20db64cc42f91ff1b46d17093667ab8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```bsl | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
;UDF R3 CRMP
global hGTA := 0x0
global dwGTAPID := 0x0
global dwSAMP := 0x0
global pMemory := 0x0
global pParam1 := 0x0
global pParam2 := 0x0
global pParam3 := 0x0
global pParam4 := 0x0
global pParam5 := 0x0
global pInjectFunc := 0x0
global iRefreshHandles := 0
global pInjectFunc := 0x0
global nZone := 1
global nCity := 1
global bInitZaC := 0
global iRefreshScoreboard := 0
global oScoreboardData := ""
global iRefreshHandles := 0
global iUpdateTick := 2500
global bCheckSizeOnce := 1
global SAMP_INFO_OFFSET := 0x21A0F8
global SAMP_PPOOLS_OFFSET := 0x3CD
global SAMP_PPOOL_PLAYER_OFFSET := 0x18
global SAMP_SLOCALPLAYERID_OFFSET := 0x4
global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET := 0x1A
global SAMP_SZLOCALPLAYERNAME_OFFSET := 0xA
global SAMP_PSZLOCALPLAYERNAME_OFFSET := 0xA
global SAMP_PREMOTEPLAYER_OFFSET := 0x2E
global SAMP_ISTRLENNAME___OFFSET := 0x1C
global SAMP_SZPLAYERNAME_OFFSET := 0xC
global SAMP_PSZPLAYERNAME_OFFSET := 0xC
global SAMP_ILOCALPLAYERPING_OFFSET := 0x26
global SAMP_ILOCALPLAYERSCORE_OFFSET := 0x2A
global SAMP_IPING_OFFSET := 0x28
global SAMP_ISCORE_OFFSET := 0x24
global SAMP_ISNPC_OFFSET := 0x4
global SAMP_SZIP_OFFSET := 0x20
global SAMP_SZHOSTNAME_OFFSET := 0x121
global SAMP_PLAYER_MAX := 1004
global SIZE_SAMP_CHATMSG := 0xFC
; SAMP Addresses
global ADDR_SAMP_INCHAT_PTR := 0x21A10C
global ADDR_SAMP_INCHAT_PTR_OFF := 0x55
global ADDR_SAMP_USERNAME := 0x219A6F
global ADDR_SAMP_CHATMSG_PTR := 0x21A0E4
global ADDR_SAMP_SHOWDLG_PTR := 0x21A0B8
global FUNC_SAMP_SENDCMD := 0x698C0
global FUNC_SAMP_SENDSAY := 0x5A00
global FUNC_SAMP_ADDTOCHATWND := 0x64520
global FUNC_SAMP_SHOWGAMETEXT := 0x9C2C0
global FUNC_SAMP_PLAYAUDIOSTR := 0x62DA0
global FUNC_SAMP_STOPAUDIOSTR := 0x629A0
global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
global FUNC_UPDATESCOREBOARD := 0x8A10
; GTA Addresses
global ADDR_ZONECODE := 0xA49AD4
global ADDR_POSITION_X := 0xB6F2E4
global ADDR_POSITION_Y := 0xB6F2E8
global ADDR_POSITION_Z := 0xB6F2EC
global ADDR_CPED_PTR := 0xB6F5F0
global ADDR_CPED_HPOFF := 0x540
global ADDR_CPED_ARMOROFF := 0x548
global ADDR_VEHICLE_PTR := 0xBA18FC
global ADDR_VEHICLE_HPOFF := 0x4C0
global ADDR_CPED_MONEY := 0xB7CE50
global ADDR_CPED_INTID := 0xA4ACE8
global ADDR_VEHICLE_DOORSTATE := 0x4F8
global ADDR_VEHICLE_ENGINESTATE := 0x428
global ADDR_VEHICLE_LIGHTSTATE := 0x584
global ADDR_VEHICLE_MODEL := 0x22
global ADDR_VEHICLE_TYPE := 0x590
global ADDR_VEHICLE_DRIVER := 0x460
global ERROR_OK := 0
global ERROR_PROCESS_NOT_FOUND := 1
global ERROR_OPEN_PROCESS := 2
global ERROR_INVALID_HANDLE := 3
global ERROR_MODULE_NOT_FOUND := 4
global ERROR_ENUM_PROCESS_MODULES := 5
global ERROR_ZONE_NOT_FOUND := 6
global ERROR_CITY_NOT_FOUND := 7
global ERROR_READ_MEMORY := 8
global ERROR_WRITE_MEMORY := 9
global ERROR_ALLOC_MEMORY := 10
global ERROR_FREE_MEMORY := 11
global ERROR_WAIT_FOR_OBJECT := 12
global ERROR_CREATE_THREAD := 13
global DIALOG_STYLE_MSGBOX := 0
global DIALOG_STYLE_INPUT := 1
global DIALOG_STYLE_LIST := 2
global DIALOG_STYLE_PASSWORD := 3
global DIALOG_STYLE_TABLIST := 4
global DIALOG_STYLE_TABLIST_HEADERS := 5
global SAMP_DIALOG_PTR1_OFFSET := 0x1C
global SAMP_DIALOG_LINES_OFFSET := 0x44C
global SAMP_DIALOG_INDEX_OFFSET := 0x443
global SAMP_DIALOG_BUTTON_HOVERING_OFFSET := 0x465
global SAMP_DIALOG_BUTTON_CLICKED_OFFSET := 0x466
global SAMP_DIALOG_PTR2_OFFSET := 0x20
global SAMP_DIALOG_LINECOUNT_OFFSET := 0x150
global SAMP_DIALOG_OPEN_OFFSET := 0x28
global SAMP_DIALOG_STYLE_OFFSET := 0x2C
global SAMP_DIALOG_ID_OFFSET := 0x30
global SAMP_DIALOG_TEXT_PTR_OFFSET := 0x34
global SAMP_DIALOG_CAPTION_OFFSET := 0x40
global SAMP_PLAYER_MAX := 1004
global SAMP_KILLSTAT_OFFSET := 0x21A0EC
global multVehicleSpeed_tick := 0
global CheckpointCheck := 0xC7DEEA
global rmaddrs := [0xC7DEC8, 0xC7DECC, 0xC7DED0]
findChatLine(text, fLines=10) { ; fLines - сколько попыток поиска (снизу вверх), по-умолчанию 10.
line_index = -1
loop, % fLines
{
line_index += 1
line_text := GetChatLine(line_index)
if line_text contains %text%
{
finded = 1
break
}
}
}
waitForSingleObject(hThread, dwMilliseconds) {
if (!hThread) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
getDist(pos1,pos2) {
if(!pos1 || !pos2)
return 0
return Sqrt((pos1[1]-pos2[1])(pos1[1]-pos2[1])+(pos1[2]-pos2[2])(pos1[2]-pos2[2])+(pos1[3]-pos2[3])(pos1[3]-pos2[3]))
}
callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true, thiscall = false) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return false
}
validParams := 0
i := aParams.MaxIndex()
dwLen := i * 5 + 5 + 1
if (bCleanupStack)
dwLen += 3
VarSetCapacity(injectData, i * 5 + 5 + 3 + 1, 0)
i_ := 1
while(i > 0) {
if (aParams[i][1] != "") {
dwMemAddress := 0x0
if (aParams[i][1] == "p") {
dwMemAddress := aParams[i][2]
} else if (aParams[i][1] == "s") {
if (i_>3)
return false
dwMemAddress := pParam%i_%
writeString(hProcess, dwMemAddress, aParams[i][2])
if (ErrorLevel)
return false
i_ += 1
} else if (aParams[i][1] == "i") {
dwMemAddress := aParams[i][2]
} else {
return false
}
NumPut((thiscall && i == 1 ? 0xB9 : 0x68), injectData, validParams * 5, "UChar")
NumPut(dwMemAddress, injectData, validParams * 5 + 1, "UInt")
validParams += 1
}
i -= 1
}
offset := dwFunc - ( pInjectFunc + validParams * 5 + 5 )
NumPut(0xE8, injectData, validParams * 5, "UChar")
NumPut(offset, injectData, validParams * 5 + 1, "Int")
if (bCleanupStack) {
NumPut(0xC483, injectData, validParams * 5 + 5, "UShort")
NumPut(validParams4, injectData, validParams * 5 + 7, "UChar")
NumPut(0xC3, injectData, validParams * 5 + 8, "UChar")
} else {
NumPut(0xC3, injectData, validParams * 5 + 5, "UChar")
}
writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
if (ErrorLevel)
return false
hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
if (ErrorLevel)
return false
waitForSingleObject(hThread, 0xFFFFFFFF)
closeProcess(hThread)
return true
}
writeRaw(hProcess, dwAddress, pBuffer, dwLen) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return false
}
}
writeString(hProcess, dwAddress, wString) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return false
}
}
readMem(hProcess, dwAddress, dwLen=4, type="UInt") {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
readDWORD(hProcess, dwAddress) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
readFloat(hProcess, dwAddress) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
readString(hProcess, dwAddress, dwLen) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
getModuleBaseAddress(sModule, hProcess) {
if (!sModule) {
ErrorLevel := ERROR_MODULE_NOT_FOUND
return 0
}
}
closeProcess(hProcess) {
if (hProcess == 0) {
ErrorLevel := ERROR_INVALID_HANDLE
return 0
}
}
openProcess(dwPID, dwRights = 0x1F0FFF) {
hProcess := DllCall("OpenProcess", "UInt", dwRights, "int", 0, "UInt", dwPID, "Uint")
if (hProcess == 0) {
ErrorLevel := ERROR_OPEN_PROCESS
return 0
}
}
getPID() {
local dwPID := 0
WinGet, dwPID, PID, GTA:SA:MP
return dwPID
}
refreshMemory() {
if (!pMemory) {
pMemory := virtualAllocEx(hGTA, 6144, 0x1000 | 0x2000, 0x40)
if (ErrorLevel) {
pMemory := 0x0
return false
}
pParam1 := pMemory
pParam2 := pMemory + 1024
pParam3 := pMemory + 2048
pParam4 := pMemory + 3072
pParam5 := pMemory + 4096
pInjectFunc := pMemory + 5120
}
return true
}
refreshSAMP() {
if (dwSAMP)
return true
}
refreshGTA() {
newPID := getPID()
if (!newPID) { ; GTA not found
if (hGTA) { ; open handle
virtualFreeEx(hGTA, pMemory, 0, 0x8000)
closeProcess(hGTA)
hGTA := 0x0
}
dwGTAPID := 0
hGTA := 0x0
dwSAMP := 0x0
pMemory := 0x0
return false
}
}
checkHandles() {
if (iRefreshHandles+500>A_TickCount)
return true
}
writeMemory(hProcess, address, writevalue,length=4, datatype="int") {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return false
}
}
writeByte(hProcess, dwAddress, wInt) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return false
}
wInt := IntToHex(wInt)
dwRet := DllCall("WriteProcessMemory", "UInt", hProcess, "UInt", dwAddress, "UInt *", wInt, "UInt", 1, "UInt *", 0)
}
FloatToHex(value) {
format := A_FormatInteger
SetFormat, Integer, H
result := DllCall("MulDiv", Float, value, Int, 1, Int, 1, UInt)
SetFormat, Integer, %format%
return, result
}
IntToHex(int) {
CurrentFormat := A_FormatInteger
SetFormat, integer, hex
int += 0
SetFormat, integer, %CurrentFormat%
return int
}
writeFloat(hProcess, dwAddress, wFloat) {
if (!hProcess) {
ErrorLevel := ERROR_INVALID_HANDLE
return false
}
wFloat := FloatToHex(wFloat)
dwRet := DllCall("WriteProcessMemory", "UInt", hProcess, "UInt", dwAddress, "UInt ", wFloat, "UInt", 4, "UInt ", 0)
ErrorLevel := ERROR_OK
return true
}
HexToDec(str) {
local newStr := ""
static comp := {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, "a":10, "b":11, "c":12, "d":13, "e":14, "f":15}
str := RegExReplace(str.down(str), "^0x|[^a-f0-9]+", "")
Loop, % StrLen(str)
newStr .= SubStr(str, (StrLen(str)-A_Index)+1, 1)
newStr := StrSplit(newStr, "")
local ret := 0
for i,char in newStr
ret += comp[char](16*(i-1))
return ret
}
HexToDecOne(Hex) {
if (InStr(Hex, "0x") != 1)
Hex := "0x" Hex
return, Hex + 0
}
HexToDecTwo(hex) {
VarSetCapacity(dec, 66, 0),
val := DllCall("msvcrt.dll_wcstoui64", "Str", hex, "UInt", 0, "UInt", 16, "CDECL Int64"), DllCall("msvcrt.dll_i64tow", "Int64", val, "Str", dec, "UInt", 10, "CDECL")
return dec
}
hex2rgb(CR) {
NumPut((InStr(CR, "#") ? "0x" SubStr(CR, 2) : "0x") SubStr(CR, -5), (V := "000000"))
return NumGet(V, 2, "UChar") "," NumGet(V, 1, "UChar") "," NumGet(V, 0, "UChar")
}
rgb2hex(R, G, B, H := 1) {
static U := A_IsUnicode ? "_wcstoui64" : "_strtoui64"
static V := A_IsUnicode ? "_i64tow" : "_i64toa"
rgb := ((R << 16) + (G << 8) + B)
H := ((H = 1) ? "#" : ((H = 2) ? "0x" : ""))
VarSetCapacity(S, 66, 0)
value := DllCall("msvcrt.dll" U, "Str", rgb , "UInt", 0, "UInt", 10, "CDECL Int64")
DllCall("msvcrt.dll" V, "Int64", value, "Str", S, "UInt", 16, "CDECL")
return H S
}
writeBytes(handle, address, bytes) {
length := strlen(bytes) / 2
VarSetCapacity(toInject, length, 0)
Loop %length% {
byte := "0x" substr(bytes, ((A_Index - 1) * 2) + 1, 2)
NumPut(byte, toInject, A_Index - 1, "uchar")
}
return writeRaw(handle, address, &toInject, length)
}
__ansiToUnicode(sString, nLen = 0) {
if (!nLen) {
nLen := DllCall("MultiByteToWideChar", "Uint", 0, "Uint", 0, "Uint", &sString, "int", -1, "Uint", 0, "int", 0)
}
VarSetCapacity(wString, nLen * 2)
DllCall("MultiByteToWideChar", "Uint", 0, "Uint", 0, "Uint", &sString, "int", -1, "Uint", &wString, "int", nLen)
return wString
}
__unicodeToAnsi(wString, nLen = 0) {
pString := wString + 1 > 65536 ? wString : &wString
if (!nLen) {
nLen := DllCall("WideCharToMultiByte", "Uint", 0, "Uint", 0, "Uint", pString, "int", -1, "Uint", 0, "int", 0, "Uint", 0, "Uint", 0)
}
VarSetCapacity(sString, nLen)
DllCall("WideCharToMultiByte", "Uint", 0, "Uint", 0, "Uint", pString, "int", -1, "str", sString, "int", nLen, "Uint", 0, "Uint", 0)
return sString
}
Utf8ToAnsi(ByRef Utf8String, CodePage = 1251) {
if ((NumGet(Utf8String) & 0xFFFFFF) = 0xBFBBEF)
BOM = 3
else
BOM = 0
UniSize := DllCall("MultiByteToWideChar", "UInt", 65001, "UInt", 0, "UInt", &Utf8String + BOM, "Int", -1, "Int", 0, "Int", 0)
VarSetCapacity(UniBuf, UniSize * 2)
DllCall("MultiByteToWideChar", "UInt", 65001, "UInt", 0, "UInt", &Utf8String + BOM, "Int", -1, "UInt", &UniBuf, "Int", UniSize)
AnsiSize := DllCall("WideCharToMultiByte", "UInt", CodePage, "UInt", 0, "UInt", &UniBuf, "Int", -1, "Int", 0, "Int", 0, "Int", 0, "Int", 0)
VarSetCapacity(AnsiString, AnsiSize)
DllCall("WideCharToMultiByte", "UInt", CodePage, "UInt", 0, "UInt", &UniBuf, "Int", -1, "Str", AnsiString, "Int", AnsiSize, "Int", 0, "Int", 0)
return AnsiString
}
setGravity(state="0.008") {
if (!checkHandles())
return -1
}
setCoordinates(pos1, pos2, pos3) {
if (!checkHandles())
return -1
}
getPlayerHealth() {
if (!checkHandles())
return -1
}
getPlayerArmour() {
if (!checkHandles())
return -1
}
getPlayerMoney() {
if (!checkHandles())
return -1
}
getPlayerInteriorId() {
if (!checkHandles())
return -1
}
getPlayerSkinId() {
if (!checkHandles())
return -1
}
getPlayerWeaponId() {
if (!checkHandles())
return -1
}
checkCRMP() {
IfWinNotActive, ahk_exe gta_sa.exe
return 0
}
; Функции чтения, связанные с текущим транспортом
isPlayerInAnyVehicle() {
if (!checkHandles())
return -1
}
getVehicleHealth() {
if (!checkHandles())
return -1
}
isPlayerDriver() {
if (!checkHandles())
return -1
}
getVehicleColor() {
if (!checkHandles())
return -1
}
getVehicleSpeed() {
if(!checkHandles())
return -1
}
; Функции, связанные с координатами
getCoordinates(ByRef x, ByRef y, ByRef z) {
if (!checkHandles())
return -1
}
getPlayerCoordinates(ByRef x, ByRef y, ByRef z) {
if (!checkHandles())
return -1
}
getCameraCoordinates() {
if (!checkHandles())
return -1
}
; Функции, связанные с модулем мультиплеера
addChatMessageEx(Color, Text) {
if (!checkHandles())
return -1
}
sendChat(Text) {
if (!checkHandles())
return -1
}
isInChat() {
if (!checkHandles())
return -1
}
formatDialog(text, len=150) {
result := "", index := 0
loop, parse, text, % ""
{
index++
if A_LoopField = `n
index = 0
}
showDialog(style, caption, text, button1, button2 := "", id := 1) {
style += 0
style := Floor(style)
id += 0
id := Floor(id)
caption := "" caption
text := "" text
button1 := "" button1
button2 := "" button2
text := formatdialog(text)
}
IsPlayerInRangeOfPoint(_posX, _posY, _posZ, _posRadius)
{
getPlayerCoordinates(posX, posY, posZ)
X := posX -_posX
Y := posY -_posY
Z := posZ -_posZ
if(((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)) && ((Z < _posRadius) && (Z > -_posRadius)))
return TRUE
return FALSE
}
setFireImmunity(state)
{
if(!checkHandles())
return
writeMemory(hGTA, 0xB7CEE6, (state ? 1 : 0), 1, "byte")
}
gmpatch()
{
if(!checkHandles())
return false
a := writeMemory(hGTA, 0x4B35A0, 0x560CEC83, 4, "int")
b := writeMemory(hGTA, 0x4B35A4, 0xF18B, 2, "byte")
return (a && b)
}
toggleNoDamageByWeapon(tog := -1)
{
if(!checkHandles())
return -1
byte := readMem(hGTA, 0x60A5BA, 1, "byte")
if((tog == -1 && byte == 216) || tog == true || tog == 1)
{
writeBytes(hGTA, 0x60A5BA, "909090")
return true
} else if((tog == -1 && byte == 144) || !tog)
{
writeBytes(hGTA, 0x60A5BA, "D95E18")
return false
}
addChatMessageEx(0xCC0000, "only for gta_sa.exe 1.0 us")
return -1
}
toggleInvulnerability(tog := -1)
{
if(!checkHandles())
return -1
byte := readMem(hGTA, 0x60A5BA, 1, "byte")
if((tog == -1 && byte == 217) || tog == true || tog == 1)
{
writeBytes(hGTA, 0x4B3314, "909090")
return true
} else if((tog == -1 && byte == 144) || !tog)
{
writeBytes(hGTA, 0x4B3314, "D86504")
return false
}
addChatMessageEx(0xCC0000, "only for gta_sa.exe 1.0 us")
return -1
}
getDialogCaption() {
if (!CheckHandles())
return -1
}
getDialogText() {
if (!CheckHandles())
return -1
}
AntiPause() {
if(!checkHandles())
return false
writeBytes(hGTA, 0x747FB6, "01")
writeBytes(hGTA, 0x74805A, "01")
writeBytes(hGTA, 0x74542B, "90909090909090")
writeBytes(hGTA, 0x74542C, "90909090909090")
writeBytes(hGTA, 0x74542D, "909090909090")
return
}
GetChatLine(Line, timestamp=0, color=0){
FileRead, file, % path_chatlog
chatindex := 0
loop, Parse, file,
n,
r{
if(A_LoopField)
chatindex := A_Index
}
}
UnlockFps(status) {
if(!checkHandles())
return false
if (status = 1) {
dwSAMP := getModuleBaseAddress("samp.dll", hGTA)
writeMemory(hGTA, dwSAMP + 0x9D9D0, 1347550997, 4, "UInt")
}
if (status = 0) {
dwSAMP := getModuleBaseAddress("samp.dll", hGTA)
writeMemory(hGTA, dwSAMP + 0x9D9D0, 4294417384, 4, "UInt")
}
return
}
setInfiniteRun(state)
{
if(!checkHandles())
return
writeMemory(hGTA, 0xB7CEE4, (state ? 1 : 0), 1, "byte")
}
PauseGame(state="") ; 0 - leave, 1 - shows
{
if(!checkHandles())
return
}
PrintLow(text, time) {
;0x69F1E0 = PrintLowPriorityMessage(const char* text, int time_in_ms, int unknown1 = 1, int unknown2 = 1);
if(!checkHandles())
return -1
dwFunc := 0x69F1E0
callwithparams(hGta, dwFunc, [["s",text], ["i", time], ["i", 1], ["i", 1]], true)
}
setCarNitro() {
If(!checkHandles())
return -1
return writeMemory(hGTA, 0x969165, 0x1)
}
toggleMotionBlur(tog := -1)
{
if(!checkHandles())
return -1
byte := readMem(hGTA, 0x704E8A, 1, "byte")
if((tog == -1 && byte == 144) || tog == true || tog == 1)
{
writeBytes(hGTA, 0x704E8A, "E811E2FFFF")
return true
} else if((tog == -1 && byte == 232) || !tog)
{
writeBytes(hGTA, 0x704E8A, "9090909090")
return false
}
return -1
}
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)
}
getWeatherID() {
if(!checkHandles())
return -1
}
setWeather(id)
{
if(!checkHandles())
return
VarSetCapacity(weather, 1, 0)
NumPut(id, weather, 0, "Int")
writeRaw(hGTA, 0xC81320, &weather, 1)
if(ErrorLevel)
return false
}
setPlayerFreeze(status) {
if(!checkHandles())
return -1
}
IsPlayerFreezed() {
if(!checkHandles())
return -1
}
IsInAfk() {
res := readMem(hGTA, 0xBA6748 + 0x5C)
WinGet, win, MinMax, ahk_exe gta_sa.exe
if ((res=0) and (win=-1)) or res=1
return 1
}
setPlayerHealth(amount) {
if(!checkHandles())
return -1
}
setPlayerArmor(amount) {
if(!checkHandles())
return -1
}
setVehicleHealth(amount) {
if(!checkHandles())
return -1
}
class sampCfg
{
fpslimit() {
loop, read, % path_cfg
{
RegExMatch(A_LoopReadLine, "fpslimit=(.*)", out)
if out1
return out1
}
}
}
class chat {
input(text, hide="") {
global
StringReplace, text, text,
%w,
{FFFFFF}, All StringReplace, text, text,
%r,{FF6347
}, AllStringReplace, text, text,
%b,
{4169E1}, All StringReplace, text, text,
\n,n, All StringReplace, text, text,
\r,r, All StringReplace, text, text,
\t, `t, All}
chat_queue() {
index = 0
loop, parse, chat_queue,
n { index = 1 queue_text := A_LoopField StringReplace, chat_queue, chat_queue, % A_LoopField "
n",,break
}
}
processDialog() {
global
ControlSend,, {space}, ahk_exe gta_sa.exe
sleep 100
dialogInputText := readString(hGTA, dwsamp + 0x141a78, 512)
cancelDialog()
return
}
cancelDialog() {
global
dialogCaptured = 1
ControlSend,, {enter}, ahk_exe gta_sa.exe
return
}
_commandprocessor() {
IfWinNotActive, ahk_exe gta_sa.exe
return
}
checkEnter() {
IfWinNotActive, ahk_exe gta_sa.exe
return
}
__CommandProcessor() {
while IsInChat()
continue
}