ffi.cdef[[
typedef void*(__thiscall* get_client_entity_t)(void*, int);
]]
local uintptr_t = ffi.typeof("uintptr_t**")
local this_call = function(call_function, parameters)
return function(...)
return call_function(parameters, ...)
end
end
local entity_list_003 = ffi.cast(uintptr_t, utils.create_interface("client.dll", "VClientEntityList003"))
local get_entity_address = this_call(ffi.cast("get_client_entity_t", entity_list_003[0][3]), entity_list_003)
local original = ffi.cast("uintptr_t", utils.opcode_scan("client.dll", "8B F1 80 BE ? ? ? ? ? 74 36", - 5))
local original_func = ffi.cast("void(__thiscall*)(void*, void*)", original)
local function update_clientside(ecx, edx)
original_func(ecx, edx)
end
events.createmove_run:set(function()
local self = entity.get_local_player()
if not self or not self:is_alive() then
return
end
local self_index = self:get_index()
local self_address = get_entity_address(self_index)
update_clientside(self_address, nil)
end)