static bool lastvelsaved = false; //saver
static int lastjump, lastvel, lasttick = 0; // last vel holder
static std::string drawvel; //text drawer holder
static std::string drawvel2;
if (g_Options.misc_velo && g_EngineClient->IsConnected() && g_EngineClient->IsInGame() && g_LocalPlayer) {
int screenWidth, screenHeight;
g_EngineClient->GetScreenSize(screenWidth, screenHeight);
auto local_player = g_LocalPlayer;
Vector speed = local_player->m_vecVelocity();
int intspeed = round(speed.Length2D());
const float delta = intspeed - lastvel;
std::string vel = std::to_string(intspeed);
if (g_LocalPlayer->m_fFlags() & FL_ONGROUND)
{
if (lastvelsaved)
{
lastvelsaved = false;
}
drawvel = vel;
}
else
{
if (!lastvelsaved)
{
lastjump = intspeed;
lastvelsaved = true;
}
if (g_Options.misc_pre)
drawvel = vel + " (" + std::to_string(lastjump) + ")";
else
drawvel = vel;
}
drawvel2 = "(" + std::to_string(lastjump) + ")";
Color col = Color::Color(255, 255, 255);
if (delta < 0) {
col = Color::Color(225, 100, 100);
}
else if (delta > 0) {
col = Color::Color(255, 200, 100);
}
else if (delta == 0) {
col = Color::Color(25, 255, 100);
}
if (g_GlobalVars->tickcount < lasttick) {
lasttick = g_GlobalVars->tickcount;
lastvel = intspeed;
}
if (g_GlobalVars->tickcount > lasttick + 16)
{
lasttick = g_GlobalVars->tickcount;
lastvel = intspeed;
}
Color black = Color::FromHSB(0, 0, 0);
Render::Get().RenderText(drawvel, screenWidth / 2 + 2, screenHeight - g_Options.misc_velooffset + 1, g_Options.misc_velosize, black, true, false, g_pSecondFont);
Render::Get().RenderText(drawvel, screenWidth / 2, screenHeight - g_Options.misc_velooffset, g_Options.misc_velosize, col, true, false, g_pSecondFont);
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}