Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature currently requires accessing the site using the built-in Safari browser.
-- #angle_t
angle_t.to_vector = function( self ) return vec3_t
angle_t.show = function( self ) return 'string'
-- #color_t
local col = function( r, g, b, a )
return color_t(r or 1, b and g or r or 1, b or r or 1, a or not b and g or 1)
end
color_t["alpha"] = function( self, alpha ) return color_t
color_t["lerp"] = function( first, second, a: float ) return color_t
color_t["pulse"] = function( first, second, speed: float, offset: float ) return color_t
color_t["show"] = function( self ) return 'string'
--[[
local color = color_t(1, 0, 0, 1)
print(color:show())
color = color:alpha(0.5)
print(color:show())
color = color:lerp(color_t(0, 1, 0, 1), 0.5)
print(color:show())
color = color:pulse(color_t(0, 0, 1, 1), 1, 0.5)
print(color:show())
]]
-- #vec2_t #vec3_t
local vec = function( x, y, z )
return z and vec3_t(x, y, z) or vec2_t(x, y)
end
vec2_t.show = function( self ) return 'string'
vec3_t.show = function( self ) return 'string'
vec2_t.lerp = function( first, second, a ) return vec2_t
vec3_t.lerp = function( first, second, a ) return vec3_t
vec3_t.to_angle = function( self ) return angle_t
vec3_t.calc_angle = function ( from: vec3_t, to: vec3_t ) return angle_t
--[[
local vector = vec(0, 1, 0)
print(vector:show())
vector = vector:lerp(vec(1, 0, 0), 0.5)
print(vector:show())
local angle = vector:to_angle()
print(angle:show())
angle = vec3_t.calc_angle(vec(0, 0, 0), vec(1, 1, 1))
print(angle:show())
]]
-- #entity
entity.get_origin = function( pawn ) return vec3_t
entity.get_eye_pos = function( pawn ) return vec3_t
entity.controller_to_pawn = function( controller ) return player_pawn or nil
entity.pawn_to_controller = function( pawn ) return controller or nil
entity.velocity = function( pawn, is_vector: bool ) return vec3_t or float
entity.get_health = function( pawn ) return int
entity.is_alive = function( pawn ) return bool
entity.condition = function( pawn ) return string
entity.active_weapon = function( pawn ) return entity or nil
entity.get_weapon_index = function( pawn ) return int
entity.weapon_name = function( pawn ) return string
--[[
local pawn = entitylist.get_local_player_pawn()
if not pawn then return end
local health = entity.get_health(pawn) -- pawn:get_health()
print(string.format('health: %s', health))
local is_alive = entity.is_alive(pawn)
print(string.format('is_alive: %s', is_alive))
if not is_alive then return end
local origin = entity.get_origin(pawn) -- pawn:get_origin()
print(string.format('origin: %s', origin:show()))
local eye_pos = entity.get_eye_pos(pawn) -- pawn:get_eye_pos()
print(string.format('eye_pos: %s', eye_pos:show()))
local velocity = entity.velocity(pawn) -- pawn:velocity() -- float
print(string.format('velocity: %s', velocity))
local velocity = entity.velocity(pawn, true) -- pawn:get_velocity(true) -- vec3_t
print(string.format('velocity: %s', velocity:show()))
local active_weapon = entity.active_weapon(pawn) -- pawn:active_weapon()
print(string.format('active_weapon: %s', active_weapon))
local weapon_index = entity.get_weapon_index(pawn) -- active_weapon:get_weapon_index()
print(string.format('weapon_index: %s', weapon_index))
]]
-- #engine
engine.get_view_angles = function () return angle_t
local show = function ()
local pawn = entitylist.get_local_player_pawn()
if not entity.is_alive(pawn) then return end
local pawn = entitylist.get_local_player_pawn()
if not pawn then return end
local health = entity.get_health(pawn) -- pawn:get_health()
print(string.format('health: %s', health))
local is_alive = entity.is_alive(pawn)
print(string.format('is_alive: %s', is_alive))
if not is_alive then return end
local origin = entity.get_origin(pawn) -- pawn:get_origin()
print(string.format('origin: %s', origin:show()))
local eye_pos = entity.get_eye_pos(pawn) -- pawn:get_eye_pos()
print(string.format('eye_pos: %s', eye_pos:show()))
local velocity = entity.velocity(pawn) -- pawn:velocity() -- float
print(string.format('velocity: %s', velocity))
local velocity = entity.velocity(pawn, true) -- pawn:get_velocity(true) -- vec3_t
print(string.format('velocity: %s', velocity:show()))
local active_weapon = entity.active_weapon(pawn) -- pawn:active_weapon()
print(string.format('active_weapon: %s', active_weapon))
local weapon_index = entity.get_weapon_index(pawn) -- pawn:get_weapon_index()
print(string.format('weapon_index: %s', weapon_index))
local weapon_name = entity.weapon_name(pawn) -- active_weapon:weapon_name()
print(string.format('weapon_name: %s', weapon_name))
end
show()
local vec = function( x, y, z )
return z and vec3_t(x, y, z) or vec2_t(x, y)
end
local col = function( r, g, b, a )
return color_t(r or 1, b and g or r or 1, b or r or 1, a or not b and g or 1)
end
local demo = function ()
local vector = vec(0, 1, 0)
print(vector:show())
vector = vector:lerp(vec(1, 0, 0), 0.5)
print(vector:show())
local angle = vector:to_angle()
print(angle:show())
angle = vec3_t.calc_angle(vec(0, 0, 0), vec(1, 1, 1))
print(angle:show())
local color = color_t(1, 0, 0, 1)
print(color:show())
color = color:alpha(0.5)
print(color:show())
color = color:lerp(color_t(0, 1, 0, 1), 0.5)
print(color:show())
color = color:pulse(color_t(0, 0, 1, 1), 1, 0.5)
print(color:show())
end
local gui = {
hello = {
type = 'checkbox',
},
repeats = {
type = 'slider',
min = 1,
max = 10,
},
['hi'] = {
type = 'checkbox',
var_name = 'check2',
default = true
},
['demo'] = {
type = 'checkbox',
var_name = 'demso',
params = {
show = {
type = 'checkbox'
},
render = {
type = 'checkbox'
}
}
}
}
register_callback('paint', function ()
if gui.hello.var and gui.hello.var:get() then
gui.hello.var:set(false)
for i = 1, gui.repeats.var:get() do
print('hello')
end
end
if gui.hi.var and gui.hi.var:get() then
gui.hi.var:set(false)
print('hi')
end
if gui.demo.var and gui.demo.var:get() then
if gui.demo.params.show.var:get() then
gui.demo.params.show.var:set(false)
demo()
end
if gui.demo.params.render.var:get() then
local t = os.clock() * 3
render.circle_filled(vec(200 + 40 * math.cos(t), 200 + 40 * math.sin(t)), 20, 10, col():pulse(col(1, 0, 0), 2))
end
end
end)
return gui
мега крутой сигматы сигма крутой сигма?