Кто шарит сделайте поддержку скрипта на R1

Статус
В этой теме нельзя размещать новые ответы.

Otvertka1337

Известный
Автор темы
13
2
Версия MoonLoader
.027.0-preview
Lua:
script_name("NameTagHack")
script_author("seven.eXe")

local ffi = require "ffi"
require "moonloader"

local hackAct = false

ffi.cdef[[
    struct stSAMP
    {
        char                    pad_0[44];
        void                    *m_pRakClient;
        char                    m_szHostAddress[257];
        char                    m_szHostname[257];
        bool                    m_bDisableCollision;
        bool                    m_bUpdateCameraTarget;
        bool                    m_bNametagStatus;
        int                     m_nPort;
        int                     m_bLanMode;
        int                     m_aMapIcons[100];
        int                     m_nGameState;
        uint32_t                m_lastConnectAttempt;
        struct stServerPresets  *m_pSettings;
        char                    pad_2[5];
        struct stSAMPPools      *m_pPools;
    }__attribute__ ((packed));

    struct stServerPresets
    {
        uint8_t                 byteCJWalk;
        int                     m_iDeathDropMoney;
        float                    fWorldBoundaries[4];
        bool                    m_bAllowWeapons;
        float                    fGravity;
        uint8_t                 byteDisableInteriorEnterExits;
        uint32_t                ulVehicleFriendlyFire;
        bool                    m_byteHoldTime;
        bool                    m_bInstagib;
        bool                    m_bZoneNames;
        bool                    m_byteFriendlyFire;
        int                        iClassesAvailable;
        float                    fNameTagsDistance;
        bool                    m_bManualVehicleEngineAndLight;
        uint8_t                 byteWorldTime_Hour;
        uint8_t                 byteWorldTime_Minute;
        uint8_t                 byteWeather;
        uint8_t                 byteNoNametagsBehindWalls;
        int                     iPlayerMarkersMode;
        float                    fGlobalChatRadiusLimit;
        uint8_t                 byteShowNameTags;
        bool                    m_bLimitGlobalChatRadius;
    }__attribute__ ((packed));
]]

function main()
    while true do
        wait(0)
        if isKeyDown(VK_MENU) and isKeyJustPressed(VK_F3) then
            hackAct = not hackAct
            if hackAct then
                nameTagDist = sampGetSampInfoPtr().m_pSettings.fNameTagsDistance
                nameTagWalls = sampGetSampInfoPtr().m_pSettings.byteNoNametagsBehindWalls
                sampGetSampInfoPtr().m_pSettings.fNameTagsDistance = 999.0
                sampGetSampInfoPtr().m_pSettings.byteNoNametagsBehindWalls = 0
            else
                sampGetSampInfoPtr().m_pSettings.fNameTagsDistance = nameTagDist
                sampGetSampInfoPtr().m_pSettings.byteNoNametagsBehindWalls = nameTagWalls
            end
            printStringNow(hackAct and "NameTagHack ~g~activated. ~w~Author: ~r~seven.eXe" or "NameTagHack ~r~deactivated. ~w~Author: ~r~seven.eXe", 2000)
        end
    end
end

function sampGetSampInfoPtr()
    return ffi.cast('struct stSAMP**', getModuleHandle("samp.dll") + 0x26EA0C)[0] -- R4 Addr
end
 
Решение
Ошибка выдает:C Warning(s007): Exception 0xC0000005 at 0x73433727
Lua:
script_name("NameTagHack")
script_author("seven.eXe")

local ffi = require "ffi"
require "moonloader"

local hackAct = false

ffi.cdef[[
    struct stSAMP
    {
        char                pad_0[32];
        char                m_szHostAddress[257];
        char                m_szHostname[257];
        bool                m_bDisableCollision; // turns off interacting with any player in a vehicle
        bool                m_bUpdateCameraTarget;
        bool                m_bNametagStatus;
        int                 m_nPort;
        int                m_bLanMode;
        int              m_aMapIcons[100];
        int                 m_nGameState;
        unsigned...

ARMOR

011110000111100101101001
Модератор
4,939
6,741
Ошибка выдает:C Warning(s007): Exception 0xC0000005 at 0x73433727
Lua:
script_name("NameTagHack")
script_author("seven.eXe")

local ffi = require "ffi"
require "moonloader"

local hackAct = false

ffi.cdef[[
    struct stSAMP
    {
        char                pad_0[32];
        char                m_szHostAddress[257];
        char                m_szHostname[257];
        bool                m_bDisableCollision; // turns off interacting with any player in a vehicle
        bool                m_bUpdateCameraTarget;
        bool                m_bNametagStatus;
        int                 m_nPort;
        int                m_bLanMode;
        int              m_aMapIcons[100];
        int                 m_nGameState;
        unsigned long                m_lastConnectAttempt;
        struct stServerPresets*           m_pSettings;
        struct RakClientInterface* m_pRakClient;
        struct Pools*              m_pPools;
    }__attribute__ ((packed));


    struct stServerPresets {
        bool          m_bUseCJWalk;
        unsigned int  m_nDeadDropsMoney;
        float         m_fWorldBoundaries[4];
        bool          m_bAllowWeapons;
        float         m_fGravity;
        bool          m_bEnterExit;
        int          m_bVehicleFriendlyFire;
        bool          m_bHoldTime;
        bool          m_bInstagib;
        bool          m_bZoneNames;
        bool          m_bFriendlyFire;
        int          m_bClassesAvailable;
        float         m_fNameTagsDrawDist;
        bool          m_bManualVehicleEngineAndLight;
        unsigned char m_nWorldTimeHour;
        unsigned char m_nWorldTimeMinute;
        unsigned char m_nWeather;
        bool          m_bNoNametagsBehindWalls;
        int           m_nPlayerMarkersMode;
        float         m_fChatRadius;
        bool          m_bNameTags;
        bool          m_bLtdChatRadius;
    }__attribute__ ((packed));
]]

function main()
    while true do
        wait(0)
        if isKeyDown(VK_MENU) and isKeyJustPressed(VK_F3) then
            hackAct = not hackAct
            if hackAct then
                nameTagDist = sampGetSampInfoPtr().m_pSettings.m_fNameTagsDrawDist
                nameTagWalls = sampGetSampInfoPtr().m_pSettings.m_bNoNametagsBehindWalls
                sampGetSampInfoPtr().m_pSettings.m_fNameTagsDrawDist = 999.0
                sampGetSampInfoPtr().m_pSettings.m_bNoNametagsBehindWalls = 0
            else
                sampGetSampInfoPtr().m_pSettings.m_fNameTagsDrawDist = nameTagDist
                sampGetSampInfoPtr().m_pSettings.m_bNoNametagsBehindWalls = nameTagWalls
            end
            printStringNow(hackAct and "NameTagHack ~g~activated. ~w~Author: ~r~seven.eXe" or "NameTagHack ~r~deactivated. ~w~Author: ~r~seven.eXe", 2000)
        end
    end
end

function sampGetSampInfoPtr()
    return ffi.cast('struct stSAMP**', getModuleHandle("samp.dll") + 0x21A0F8)[0] -- R4 Addr
end
Ошибочка от меня. Не изменил названия объектов структур.
 
  • Нравится
Реакции: Otvertka1337
Статус
В этой теме нельзя размещать новые ответы.