-
Автор темы
- #1
JavaScript:
UI.AddSubTab(["Visuals", "SUBTAB_MGR"], "Trail")
UI.AddColorPicker(["Visuals", "Trail", "Trail"], "Trail color")
function get_velocity() {
velocity = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_vecVelocity[0]");
speed = Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
return speed;
}
var trails = [];
function trail() {
var localPlayer = Entity.GetLocalPlayer();
if (Entity.IsValid(localPlayer) && get_velocity() > 25){
var position = Entity.GetHitboxPosition(localPlayer, 6);
if(Array.isArray(position)){
trails.push({remove:Global.Tickcount() + 15, location:position});
trails.forEach(function(x, y){
var location = trails[y]["location"];
var color = UI.GetColor(["Visuals", "Trail", "Trail", "Trail color"])
color[3] = get_velocity()/25
var position = Render.WorldToScreen([location[0], location[1], location[2] - 55]);
Render.FilledCircle( position[0], position[1], 15, color);
var time = Global.Tickcount();
if (trails[y]["remove"] <= time){
trails.splice(y, 1);
}
})
}
}
}
Cheat.RegisterCallback("Draw", "trail")