ffi.cdef[[
typedef void(__cdecl *CMDPROC)(char *);
struct stInputInfo
{
void *pD3DDevice;
void *pDXUTDialog;
void *pDXUTEditBox;
CMDPROC pCMDs[144];
char szCMDNames[144][33];
int iCMDCount;
int iInputEnabled;
char szInputBuffer[129];
char szRecallBufffer[10][129];
char szCurrentBuffer[129];
int iCurrentRecall;
int iTotalRecalls;
CMDPROC pszDefaultCMD;
}__attribute__ ((packed));
]]
function inputInfo(i)
local input = ffi.cast("struct stInputInfo *", sampGetInputInfoPtr())
sampAddChatMessage('Input '..i..' '.. ffi.string(input.szRecallBufffer[i]),-1)
end
function sampGetSampInfoPtr()
return ffi.cast('struct stSAMP**', getModuleHandle("samp.dll") + 0x26E8CC)[0] -- R3 Addr
end
-- main
if wasKeyPressed(VK_N) then inputInfo(1) end