Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Anim = {
- ["pose_ducking_01"] = {
- name = "Сесть на колено",
- ACT = 2067
- },
- ["pose_ducking_02"] = {
- name = "лотус",
- ACT = 2068,
- },
- ["pose_standing_01"] = {
- name = "Стоит сложа руки",
- ACT = 2063,
- },
- ["pose_standing_02"] = {
- name = "Руки в бока",
- ACT = 2064,
- },
- ["lean_back"] = {
- name = "lean back",
- ACT = 389,
- Out = {
- ACT = 391,
- SEQUENCE = "lean_back_to_idle"
- }
- },
- ["lean_left"] = {
- name = "lean left",
- ACT = 386,
- Out = {
- ACT = 399,
- SEQUENCE = "lean_left_to_idle"
- }
- },
- ["lying_down"] = {
- name = "лежа",
- ACT = 1,
- },
- ["sit_chair"] = {
- name = "сидит",
- ACT = 395,
- Out = {
- ACT = 397,
- SEQUENCE = "sit_chair_to_idle"
- }
- },
- ["sit_ground"] = {
- name = "сидит 2",
- ACT = 392,
- Out = {
- ACT = 394,
- SEQUENCE = "sit_ground_to_idle"
- }
- },
- ["d1_t01_breakroom_sit02_entry"] = {
- name = "садится",
- ACT = 1,
- Out = {
- ACT = 1,
- SEQUENCE = "d1_t01_breakroom_sit02_exit"
- }
- },
- ["plazaidle1"] = {
- name = "облокотился с руками сзади",
- ACT = 1,
- Out = {
- ACT = 1,
- SEQUENCE = "plazastand1"
- }
- },
- ["plazaidle2"] = {
- name = "облокотился на стену",
- ACT = 1,
- Out = {
- ACT = 1,
- SEQUENCE = "plazastand2"
- }
- },
- ["plazaidle3"] = {
- name = "облокотился боком",
- ACT = 1,
- Out = {
- ACT = 1,
- SEQUENCE = "plazastand3"
- }
- },
- ["plazaidle4"] = {
- name = "кортаны",
- ACT = 1,
- Out = {
- ACT = -1,
- SEQUENCE = "plazastand4"
- }
- },
- ["sitcouchtv1"] = {
- name = "сидит с ногой на колене",
- ACT = 1,
- },
- ["sitchair1"] = {
- name = "сидит с грустинкой",
- ACT = 1,
- },
- ["sitcouchknees1"] = {
- name = "сидит с руками под коленями",
- ACT = 1,
- },
- }
- hook.Add("KeyPress", "ResetAnim", function(ply)
- if CLIENT then return end
- if ply:GetNWBool("Anim") and not ply.SandingUp then
- local data = Anim[ply:GetNWString("DoAnim")]
- local out = data.Out and data.Out.SEQUENCE or nil
- if out then
- print(321)
- ply.SandingUp = true
- ply:SetNWString("DoAnim", out)
- timer.Simple(ply:SequenceDuration(ply:LookupSequence(out)), function()
- ply:SetNWString("DoAnim", "")
- ply:SetNWBool("Anim", false)
- ply.SandingUp = false
- end)
- else
- print(123)
- ply:SetNWString("DoAnim", "")
- ply:SetNWBool("Anim", false)
- end
- end
- end)
- hook.Add( "StartCommand", "StartCommandExample", function( ply, cmd )
- if ply:GetNWBool("Anim") then
- cmd:ClearMovement()
- --cmd:ClearButtons()
- end
- end)
- hook.Add("CalcMainActivity", "dasdd", function(ply, vel)
- if not Anim[ply:GetNWString("DoAnim")] then return end
- local data = Anim[ply:GetNWString("DoAnim")]
- if not data then return end
- local out = data.Out and data.Out.SEQUENCE or nil
- if not ply.LastAnim or ply.LastAnim != ply:GetNWString("DoAnim") then
- ply.LastAnim = ply:GetNWString("DoAnim")
- --ply:SetSequence(ply:LookupSequence(ply:GetNWString("DoAnim")))
- end
- ply:FrameAdvance()
- if ply.LastAnim and ply.LastAnim != "" then
- ply:SetNWBool("Anim", true)
- ply:ResetSequence(ply:LookupSequence(ply.LastAnim))
- ply:SetCycle( 0 )
- return -1, ply:LookupSequence(ply.LastAnim)
- end
- end)
- hook.Add( "UpdateAnimation", "GBAnim", function( ply, _, __ )
- if not ply:Alive() then return end
- if ply:InVehicle() then return end
- if ply:GetNWString("DoAnim") == "" then return end
- ply:SetPlaybackRate( 1 )
- return true
- end)
- if CLIENT then
- local _x, _y = 0, 0
- hook.Add("InputMouseApply", "LookAround", function(c, x, y, a)
- if LocalPlayer():GetNWBool("Anim") then
- c:SetMouseX(0)
- c:SetMouseY(0)
- _x, _y = Lerp(.1, _x, x), Lerp(.1, _y, y)
- return true
- else
- return false
- end
- end)
- hook.Add( "CalcView", "LookAround", function( ply, pos, angles, fov )
- if ply:GetNWBool("Anim") then
- local around = gui.ScreenToVector(ScrW() / 2 + _x, ScrH() / 2 + _y)
- local tr = util.TraceLine({
- start = ply:GetAttachment(ply:LookupAttachment("eyes")).Pos,
- endpos = pos-(around:Angle():Forward() * 75 - around:Angle():Up() * -15),
- filter = ply,
- })
- local view = {}
- view.origin = tr.HitPos
- view.angles = around:Angle()
- view.fov = fov
- view.drawviewer = true
- return view
- end
- end)
- return
- end
- hook.Add("PlayerSay", "Sdpqmdm2", function(ply, txt)
- if ply:InVehicle() then return end
- if ply:GetNWBool("Anim") then return end
- ply:SetNWString("DoAnim", txt)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement