-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
У меня не получается сделать тень как в ските.. Помогите!
JavaScript:
var time_to_ticks = function(a)
{
return Math.floor(0.5 + a / Globals.TickInterval())
}
fakelag = time_to_ticks(Globals.Curtime() - Entity.GetProp(Entity.GetLocalPlayer(), "DT_CSPlayer", "m_flSimulationTime")) + 1
if(fakelag < 0)
fakelag = 0
if(fakelag > 13)
fakelag = 13
Render.Arc = function (x, y, radius, radius_inner, start_angle, end_angle, segments, color)
{
segments = 360 / segments;
for (var i = start_angle; i < start_angle + end_angle; i = i + segments)
{
var rad = i * Math.PI / 180;
var rad2 = (i + segments) * Math.PI / 180;
var rad_cos = Math.cos(rad);
var rad_sin = Math.sin(rad);
var rad2_cos = Math.cos(rad2);
var rad2_sin = Math.sin(rad2);
var x1_inner = x + rad_cos * radius_inner;
var y1_inner = y + rad_sin * radius_inner;
var x1_outer = x + rad_cos * radius;
var y1_outer = y + rad_sin * radius;
var x2_inner = x + rad2_cos * radius_inner;
var y2_inner = y + rad2_sin * radius_inner;
var x2_outer = x + rad2_cos * radius;
var y2_outer = y + rad2_sin * radius;
Render.Polygon( [
[ x1_outer, y1_outer ],
[ x2_outer, y2_outer ],
[ x1_inner, y1_inner ] ],
color
);
Render.Polygon( [
[ x1_inner, y1_inner ],
[ x2_outer, y2_outer ],
[ x2_inner, y2_inner ] ],
color
);
}
}
Render.Back = function (x,y)
{
Render.GradientRect(x,y,25,26,1,[0,0,0,0],[0,0,0,30])
Render.GradientRect(x+25,y,25,26,1,[0,0,0,30],[0,0,0,0])
}
function skeet()
{
font = Render.AddFont('Calibrib', 15, 500)
var screensize = Render.GetScreenSize()
var y = screensize[1]/4
var fakelag = time_to_ticks(Globals.Curtime() - Entity.GetProp(Entity.GetLocalPlayer(), "DT_CSPlayer", "m_flSimulationTime")) + 1
Render.Back(22,y*3+-162, [17, 17, 17, 100])
Render.StringCustom(22,y*3+-159,0,'FL',[0, 0, 0,255],font)
Render.StringCustom(22,y*3+-160,0,'FL',[199, 209, 255,255],font)
Render.Arc(65,y*3+-150,10,6,0,360,120,[0,0,0,255])
Render.Arc(65,y*3+-150,9,7,0,fakelag * 20,120,[199, 209, 255,255])
}
Cheat.RegisterCallback('Draw','skeet')