ffi.cast('void (__thiscall*)(void*)', sampGetBase() + SAMP_FUNC_CURSORUNLOCKACTORCAM)(obj) не работает почему-то.
Lua:
local ffi = require 'ffi'
local memory = require 'memory'
SAMP_MISC_INFO = 0x21A10C
SAMP_FUNC_TOGGLECURSOR = 0x9BD30
SAMP_FUNC_CURSORUNLOCKACTORCAM = 0x9BC10
function sampGetBase()
return getModuleHandle('samp.dll')
end
function sampGetMiscInfoPtr()
return memory.getint32( sampGetBase() + SAMP_MISC_INFO )
end
function sampToggleCursor(showed)
if type(showed) ~= 'boolean' then showed = false end
local obj = ffi.cast('void**', sampGetMiscInfoPtr() )
local show = ffi.cast('void (__thiscall*)(void*, int, bool)', sampGetBase() + SAMP_FUNC_TOGGLECURSOR)
show(obj, showed and 3 or 0, showed)
if not showed then
ffi.cast('void (__thiscall*)(void*)', sampGetBase() + SAMP_FUNC_CURSORUNLOCKACTORCAM)(obj)
end
end
вопрос:
@FYP
чем можно заменить std::string?
Последнее редактирование: