Rookie HvHer
- User ID
- 72379
- Messages
- 23
- Reactions
- 8
- Level
- 4
the code is written for airflow v1
I do not know why you need it, but let it be
code:
int iter = 0;
std::string last_tag = ("");
void c_utils::clantag()
{
if (!g_ctx.local)
return;
auto set_clan_tag = [](const char* tag, const char* name)
{
static auto fn = patterns::clantag.as< void(__fastcall*)(const char*, const char*) >();
fn(tag, name);
};
static bool reset_tag = true;
static int last_clantag_time = 0;
auto clantag_time = (int)((interfaces::global_vars->cur_time * 2.f) + g_ctx.ping);
if (g_cfg.misc.clantag)
{
reset_tag = false;
static int prev_array_stage = 0;
static char tag_stages[] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0b,
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16
};
// @note: clantag from gamesense.pub
auto time = 0.3f / interfaces::global_vars->interval_per_tick;
auto iter = interfaces::client_state->clock_drift_mgr.server_tick / static_cast<int> (time + 0.5f) % 30;
auto new_array_stage = tag_stages[iter];
if (prev_array_stage != new_array_stage) {
char gamesense[40] = { 0 };
strcpy(gamesense, (" gamesense ")); // @note: gamesense -> airflow.su
char* current_tag = &gamesense[new_array_stage];
current_tag[15] = '\0';
set_clan_tag(current_tag, current_tag);
prev_array_stage = new_array_stage;
last_tag = current_tag;
}
}
else
{
if (!reset_tag)
{
if (clantag_time != last_clantag_time)
{
set_clan_tag("", "");
reset_tag = true;
last_clantag_time = clantag_time;
}
}
}
}
I do not know why you need it, but let it be