Помогите с настройкой AIM"а на LUA

shailkiller

Известный
Автор темы
165
35
Версия MoonLoader
.026-beta
Крч, мне надо шобы AIM работал только тогда, когда я целюсь, нужен код.
(Не при зажатие клавиши RBUTTON, а именно целюсь, то-есть проверка на прицел или как-то так)
В OP-HaX по-моему так сделанно, но он для меня сейчас не юзабелен, свои причины.
 
Решение
🤦‍♂️ Копирнул всё по случайности, и вставил, сам того не заметив, так или иначе всё-ровно скрипт отказывается работать.
[12:41:47.442929] (error) AIM.lua: opcode '068C' call caused an unhandled exception
stack traceback:
[C]: in function 'isPlayerTargettingAnything'
C:\Games\Grand Theft Auto\moonloader\AIM.lua:368: in function <C:\Games\Grand Theft Auto\moonloader\AIM.lua:367>
stack traceback:
[C]: in function 'create'
C:\Games\Grand Theft Auto\moonloader\AIM.lua:226: in function <C:\Games\Grand Theft Auto\moonloader\AIM.lua:221>
[12:41:47.443931] (error) AIM.lua: Script died due to an error. (06A7AFC4)
мб функция ебаная

shailkiller

Известный
Автор темы
165
35

bool result = isPlayerTargettingAnything(Player player)
попробуй
Нихрена не получилось, ну я так и предполагал, что я криворукий и нужна будет помощь.
Lua:
function Aimbot()
    if GUI.aimbot.Enable.v and bool result = isPlayerTargettingAnything(Player player) then
        if not GUI.aimbot.IsFire.v or (GUI.aimbot.IsFire.v and isKeyDown(VK_LBUTTON)) then
            local playerID = GetNearestPed()
            if playerID ~= -1 then
                local pedID = sampGetPlayerIdByCharHandle(PLAYER_PED)
                if (GUI.aimbot.IgnoreStun.v and not CheckStuned()) then return false end
                if (GUI.aimbot.CFilter.v and sampGetPlayerColor(pedID) == sampGetPlayerColor(playerID)) then return false end
                local _, handle = sampGetCharHandleBySampPlayerId(playerID)
                local myPos = {getActiveCameraCoordinates()}
                local enPos = {GetBodyPartCoordinates(GetNearestBone(handle), handle)}
                if not GUI.aimbot.VisibleCheck.v or (GUI.aimbot.VisibleCheck.v and isLineOfSightClear(myPos[1], myPos[2], myPos[3], enPos[1], enPos[2], enPos[3], true, true, false, true, true)) then
                    local pedWeapon = getCurrentCharWeapon(PLAYER_PED)
                    if (pedWeapon >= 22 and pedWeapon <= 29) or pedWeapon == 32 then
                        coefficent = 0.04253
                    elseif pedWeapon == 30 or pedWeapon == 31 then
                        coefficent = 0.028
                    elseif pedWeapon == 33 then
                        сoefficent = 0.01897
                    end
                    local vector = {myPos[1] - enPos[1], myPos[2] - enPos[2]}
                    local angle = math.acos(vector[1] / math.sqrt((math.pow(vector[1], 2) + math.pow(vector[2], 2))))
                    local view = {fix(representIntAsFloat(readMemory(0xB6F258, 4, false))), fix(representIntAsFloat(readMemory(0xB6F248, 4, false)))}
                    if (vector[1] <= 0.0 and vector[2] >= 0.0) or (vector[1] >= 0.0 and vector[2] >= 0.0) then
                        dif = (angle + coefficent) - view[1]
                    end
                    if (vector[1] >= 0.0 and vector[2] <= 0.0) or (vector[1] <= 0.0 and vector[2] <= 0.0) then
                        dif = (-angle + coefficent) - view[1]
                    end
                    if GUI.aimbot.DynamicSmooth.v then multiplier = 5 else multiplier = 1 end
                    local smooth = dif / ((GUI.aimbot.Smooth.v * multiplier) * GUI.aimbot.SuperSmooth.v)
                    if GUI.aimbot.DynamicSmooth.v then
                        if smooth > 0.0 then
                            if smooth < lastsmooth then
                                smooth = smooth * (lastsmooth / smooth)
                            end
                        else
                            if -smooth < -lastsmooth then
                                smooth = smooth * (-lastsmooth / -smooth)
                            end
                        end
                        lastsmooth = smooth
                    end
                    if smooth > -1.0 and smooth < 0.5 and dif > -2.0 and dif < 2.0 then
                        view[1] = view[1] + smooth
                        setCameraPositionUnfixed(view[2], view[1])
                    end
                end
            end
        end
    end
    return false
end

[12:05:29.862994] (system) Loading script 'C:\Games\Grand Theft Auto\moonloader\aim.lua'...
[12:05:29.862994] (debug) New script: 0D51F014
[12:05:29.863995] (error) aim.lua: C:\Games\Grand Theft Auto\moonloader\aim.lua:368: 'then' expected near 'result'
[12:05:29.863995] (error) aim.lua: Script died due to an error. (0D51F014)
 

Rei

Известный
Друг
1,590
1,607
Нихрена не получилось, ну я так и предполагал, что я криворукий и нужна будет помощь.
Lua:
function Aimbot()
    if GUI.aimbot.Enable.v and bool result = isPlayerTargettingAnything(Player player) then
        if not GUI.aimbot.IsFire.v or (GUI.aimbot.IsFire.v and isKeyDown(VK_LBUTTON)) then
            local playerID = GetNearestPed()
            if playerID ~= -1 then
                local pedID = sampGetPlayerIdByCharHandle(PLAYER_PED)
                if (GUI.aimbot.IgnoreStun.v and not CheckStuned()) then return false end
                if (GUI.aimbot.CFilter.v and sampGetPlayerColor(pedID) == sampGetPlayerColor(playerID)) then return false end
                local _, handle = sampGetCharHandleBySampPlayerId(playerID)
                local myPos = {getActiveCameraCoordinates()}
                local enPos = {GetBodyPartCoordinates(GetNearestBone(handle), handle)}
                if not GUI.aimbot.VisibleCheck.v or (GUI.aimbot.VisibleCheck.v and isLineOfSightClear(myPos[1], myPos[2], myPos[3], enPos[1], enPos[2], enPos[3], true, true, false, true, true)) then
                    local pedWeapon = getCurrentCharWeapon(PLAYER_PED)
                    if (pedWeapon >= 22 and pedWeapon <= 29) or pedWeapon == 32 then
                        coefficent = 0.04253
                    elseif pedWeapon == 30 or pedWeapon == 31 then
                        coefficent = 0.028
                    elseif pedWeapon == 33 then
                        сoefficent = 0.01897
                    end
                    local vector = {myPos[1] - enPos[1], myPos[2] - enPos[2]}
                    local angle = math.acos(vector[1] / math.sqrt((math.pow(vector[1], 2) + math.pow(vector[2], 2))))
                    local view = {fix(representIntAsFloat(readMemory(0xB6F258, 4, false))), fix(representIntAsFloat(readMemory(0xB6F248, 4, false)))}
                    if (vector[1] <= 0.0 and vector[2] >= 0.0) or (vector[1] >= 0.0 and vector[2] >= 0.0) then
                        dif = (angle + coefficent) - view[1]
                    end
                    if (vector[1] >= 0.0 and vector[2] <= 0.0) or (vector[1] <= 0.0 and vector[2] <= 0.0) then
                        dif = (-angle + coefficent) - view[1]
                    end
                    if GUI.aimbot.DynamicSmooth.v then multiplier = 5 else multiplier = 1 end
                    local smooth = dif / ((GUI.aimbot.Smooth.v * multiplier) * GUI.aimbot.SuperSmooth.v)
                    if GUI.aimbot.DynamicSmooth.v then
                        if smooth > 0.0 then
                            if smooth < lastsmooth then
                                smooth = smooth * (lastsmooth / smooth)
                            end
                        else
                            if -smooth < -lastsmooth then
                                smooth = smooth * (-lastsmooth / -smooth)
                            end
                        end
                        lastsmooth = smooth
                    end
                    if smooth > -1.0 and smooth < 0.5 and dif > -2.0 and dif < 2.0 then
                        view[1] = view[1] + smooth
                        setCameraPositionUnfixed(view[2], view[1])
                    end
                end
            end
        end
    end
    return false
end

[12:05:29.862994] (system) Loading script 'C:\Games\Grand Theft Auto\moonloader\aim.lua'...
[12:05:29.862994] (debug) New script: 0D51F014
[12:05:29.863995] (error) aim.lua: C:\Games\Grand Theft Auto\moonloader\aim.lua:368: 'then' expected near 'result'
[12:05:29.863995] (error) aim.lua: Script died due to an error. (0D51F014)
а зачем ты просто скопипастил функцию? так пробуй

if GUI.aimbot.Enable.v and isPlayerTargettingAnything(player) then
 
  • Нравится
Реакции: shailkiller

shailkiller

Известный
Автор темы
165
35
а зачем ты просто скопипастил функцию? так пробуй

if GUI.aimbot.Enable.v and isPlayerTargettingAnything(player) then
🤦‍♂️ Копирнул всё по случайности, и вставил, сам того не заметив, так или иначе всё-ровно скрипт отказывается работать.
[12:41:47.442929] (error) AIM.lua: opcode '068C' call caused an unhandled exception
stack traceback:
[C]: in function 'isPlayerTargettingAnything'
C:\Games\Grand Theft Auto\moonloader\AIM.lua:368: in function <C:\Games\Grand Theft Auto\moonloader\AIM.lua:367>
stack traceback:
[C]: in function 'create'
C:\Games\Grand Theft Auto\moonloader\AIM.lua:226: in function <C:\Games\Grand Theft Auto\moonloader\AIM.lua:221>
[12:41:47.443931] (error) AIM.lua: Script died due to an error. (06A7AFC4)
 

Rei

Известный
Друг
1,590
1,607
🤦‍♂️ Копирнул всё по случайности, и вставил, сам того не заметив, так или иначе всё-ровно скрипт отказывается работать.
[12:41:47.442929] (error) AIM.lua: opcode '068C' call caused an unhandled exception
stack traceback:
[C]: in function 'isPlayerTargettingAnything'
C:\Games\Grand Theft Auto\moonloader\AIM.lua:368: in function <C:\Games\Grand Theft Auto\moonloader\AIM.lua:367>
stack traceback:
[C]: in function 'create'
C:\Games\Grand Theft Auto\moonloader\AIM.lua:226: in function <C:\Games\Grand Theft Auto\moonloader\AIM.lua:221>
[12:41:47.443931] (error) AIM.lua: Script died due to an error. (06A7AFC4)
мб функция ебаная
 
  • Нравится
Реакции: shailkiller