local _set_clantag = ffi.cast('int(__fastcall*)(const char*, const char*)', utils.PatternScan('engine.dll', '53 56 57 8B DA 8B F9 FF 15'))
local _last_clantag = nil
local set_clantag = function(v)
if v == _last_clantag then return end
_set_clantag(v, v)
_last_clantag = v
end
local build_tag = function(tag)
local ret = { 'тут', 'пишешь', 'анимацию',}
for i = 1, #tag do
table.insert(ret, tag:sub(1, i))
end
for i = #ret - 1, 1, -1 do
table.insert(ret, ret[i])
end
return ret
end
local tag = build_tag('')
local clantag_animation = function()
if not g_EngineClient:IsConnected() then return end
local netchann_info = g_EngineClient:GetNetChannelInfo()
if netchann_info == nil then return end
local latency = netchann_info:GetLatency(0) / g_GlobalVars.interval_per_tick
local tickcount_pred = g_GlobalVars.tickcount + latency
local iter = math.floor(math.fmod(tickcount_pred / 16, #tag + 1) + 1)
set_clantag(tag[iter])
end
cheat.RegisterCallback("draw", clantag_animation)