local ffi = require("ffi")
ffi.cdef [[
#pragma pack(push, 8)
typedef struct
{
uintptr_t raster;
} RwTexture;
#pragma pack(pop)
#pragma pack(push, 8)
typedef struct
{
RwTexture *m_pTexture;
} CSprite2d;
#pragma pack(pop)
]]
local function rwTextureGetNativeTexture(texture)
local rasterExtOffset = ffi.cast("uintptr_t*", 0xB4E9E0)[0]
return ffi.cast("void*", texture.raster + rasterExtOffset)
end
function main()
local result = loadTextureDictionary("hud")
local id = loadSprite("radardisc")
sampAddChatMessage('Sprite loaded successfully! ' .. tostring(id), -1)
local scriptSprites = ffi.cast("CSprite2d*", 0xA94B68)
print(scriptSprites[id - 1].m_pTexture) -- NULL ???!!?!?!
end