Fix some animation when latency, add QBB, clean prints, team select, weapon select tweaks, dom flag logic tweaks

This commit is contained in:
Fesiug 2024-09-16 21:15:11 -04:00
parent 1286e17447
commit 915f463b2a
Signed by: Fesiug
GPG Key ID: 374BFF45E1EEF243
8 changed files with 192 additions and 71 deletions

View File

@ -80,27 +80,40 @@ function ENT:Think()
self:EmitSound("buttons/button9.wav", 70, 100, 1) self:EmitSound("buttons/button9.wav", 70, 100, 1)
end end
elseif self:GetTeamOwned() != TeamOnPoint then elseif self:GetTeamOwned() != TeamOnPoint then
-- Enemy or early bird taking this point if self:GetCapturePercent() > 0 and self:GetTeamTaking() != TeamOnPoint then
local COLLECTED = (1/math.max( 1, 6-amtOnPoint )) * FrameTime() -- Clearing the progress of another team on yet another team's point
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 1, COLLECTED ) ) local COLLECTED = (1/math.max( 1, 6-amtOnPoint )) * FrameTime()
self:SetTeamTaking( TeamOnPoint ) self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 0, COLLECTED ) )
if self:GetCapturePercent() == 1 then if self:GetCapturePercent() == 0 then
-- Point successfully captured! -- Point successfully cleared
self:SetTeamOwned( TeamOnPoint ) self:SetTeamTaking( 0 )
self:SetTeamTaking( 0 ) self:EmitSound("buttons/button6.wav", 70, 100, 1)
self:SetCapturePercent( 0 ) end
self:EmitSound("buttons/blip1.wav", 70, 100, 1) BlockPoints = true -- Block points for this saboteur
end else
-- Enemy or early bird taking this point
BlockPoints = true -- Block points for this saboteur local COLLECTED = (1/math.max( 1, 6-amtOnPoint )) * FrameTime()
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 1, COLLECTED ) )
for ply, edata in pairs(self.Memory) do self:SetTeamTaking( TeamOnPoint )
edata.xpcollected = (edata.xpcollected or 0) + (COLLECTED * 200)
local sap = math.floor(edata.xpcollected) if self:GetCapturePercent() == 1 then
if sap >= 10 then -- Point successfully captured!
edata.xpcollected = edata.xpcollected - sap self:SetTeamOwned( TeamOnPoint )
ply:RewardXP( sap ) self:SetTeamTaking( 0 )
self:SetCapturePercent( 0 )
self:EmitSound("buttons/blip1.wav", 70, 100, 1)
end
BlockPoints = true -- Block points for this saboteur
for ply, edata in pairs(self.Memory) do
edata.xpcollected = (edata.xpcollected or 0) + (COLLECTED * 200)
local sap = math.floor(edata.xpcollected)
if sap >= 10 then
edata.xpcollected = edata.xpcollected - sap
ply:RewardXP( sap )
end
end end
end end
elseif self:GetTeamOwned() == TeamOnPoint then elseif self:GetTeamOwned() == TeamOnPoint then
@ -114,7 +127,7 @@ function ENT:Think()
if self:GetCapturePercent() == 0 then if self:GetCapturePercent() == 0 then
-- Point successfully cleared -- Point successfully cleared
self:SetTeamTaking( 0 ) self:SetTeamTaking( 0 )
self:EmitSound("buttons/button10.wav", 70, 100, 1) self:EmitSound("buttons/bell1.wav", 70, 100, 1)
end end
end end

View File

@ -46,6 +46,21 @@ local function dospawn( self )
return return
end end
local function doteamselect( self )
LocalPlayer():ConCommand( "b-cheat_setteam " .. self.iIndex )
self:GetParent():Remove()
end
local function painterly( self, w, h )
surface.SetDrawColor( self.iFaction.COLOR_DARK )
surface.DrawRect( 0, 0, w, h )
surface.SetDrawColor( self.iFaction.COLOR_MAIN )
surface.DrawOutlinedRect( 1, 1, w-2, h-2, 1 )
draw.SimpleText( l8(self.iData.name), "HUD_24", w/2, 4, self.iFaction.COLOR_MAIN, TEXT_ALIGN_CENTER )
return true
end
local function OpenDebugMenu() local function OpenDebugMenu()
if IsValid(DebugMenu) then DebugMenu:Remove() end if IsValid(DebugMenu) then DebugMenu:Remove() end
DebugMenu = vgui.Create("DFrame") DebugMenu = vgui.Create("DFrame")
@ -81,18 +96,29 @@ local function OpenDebugMenu()
vsplit:SetTop( modeller ) vsplit:SetTop( modeller )
modeller:SetModel( "models/weapons/w_pistol.mdl" ) modeller:SetModel( "models/weapons/w_pistol.mdl" )
modeller:SetFOV( 5 ) modeller:SetFOV( 5 )
local original = Vector( 0, 50, 0 )
modeller:SetCamPos( original ) modeller:SetCamPos( original )
modeller:SetLookAt( vector_origin ) modeller:SetLookAt( vector_origin )
modeller:SetPos( vector_origin )
modeller.Entity:SetAngles( angle_zero )
modeller.Standard = Vector( 0, 100, 0 )
modeller.Finalized = Vector()
function modeller:LayoutEntity( ent ) function modeller:LayoutEntity( ent )
ent:SetPos( Vector( 0, 0, 0 ) ) local the = Vector(modeller.Finalized)
ent:SetAngles( Angle( 0, 0 * RealTime() * 10 % 360, 0 ) ) the:Rotate( Angle( 0, (360/4) * RealTime() % 360, 0 ) )
modeller:SetCamPos( the )
-- ent:SetPos( Vector( 0, 0, 0 ) )
--ent:SetAngles( Angle( 0, 10 * RealTime() * 10 % 360, 0 ) )
return return
end end
modeller:SetAmbientLight( HSLToColor( 0, 0, 1.00 ) ) modeller:SetAmbientLight( HSLToColor( 0, 0, 0.00 ) )
modeller:SetDirectionalLight(BOX_TOP, HSLToColor( 0, 0, 1.00 ) )
modeller:SetDirectionalLight(BOX_FRONT, HSLToColor( 0, 0, 1.00 ) ) modeller:SetDirectionalLight(BOX_TOP, HSLToColor( 0, 0, 0.50 ) )
modeller:SetDirectionalLight(BOX_BOTTOM, HSLToColor( 0, 0, 0.50 ) )
modeller:SetDirectionalLight(BOX_FRONT, HSLToColor( 0, 0, 0.50 ) )
modeller:SetDirectionalLight(BOX_BACK, HSLToColor( 0, 0, 0.50 ) )
modeller:SetDirectionalLight(BOX_LEFT, HSLToColor( 0, 0, 1.00 ) )
modeller:SetDirectionalLight(BOX_RIGHT, HSLToColor( 0, 0, 1.00 ) ) modeller:SetDirectionalLight(BOX_RIGHT, HSLToColor( 0, 0, 1.00 ) )
function modeller:Update( mdl ) function modeller:Update( mdl )
@ -101,15 +127,19 @@ local function OpenDebugMenu()
local worked = self.Entity:PhysicsInit( SOLID_VPHYSICS ) local worked = self.Entity:PhysicsInit( SOLID_VPHYSICS )
if worked then if worked then
-- Factors the USP's bodygroup suppressor for some reason. Great
local mins, maxs = self.Entity:GetCollisionBounds() -- Factors the USP's bodygroup suppressor for some reason. Great -- Not anymore, changed it to Physics Object AABB
local mins, maxs = self.Entity:GetPhysicsObject():GetAABB()
local wsc = Vector() local wsc = Vector()
wsc:Add( mins ) wsc:Add( mins )
wsc:Add( maxs ) wsc:Add( maxs )
wsc:Div( 2 ) wsc:Div( 2 )
self:SetLookAt( wsc ) self.Entity:SetPos( -wsc )
self:SetCamPos( wsc+original )
self:SetLookAt( vector_origin )
modeller.Finalized:Set(modeller.Standard)
--self:SetCamPos( modeller.Standard )
-- local HFOV = 45-5 -- local HFOV = 45-5
-- local hfovRad = HFOV * math.pi / 180 -- local hfovRad = HFOV * math.pi / 180
@ -120,26 +150,26 @@ local function OpenDebugMenu()
-- scale test -- scale test
if true then for i=1, 50 do if true then for i=1, 50 do
local S1, S2 = false, false local S1, S2 = false, false
local aimVector = (self:GetLookAt() - self:GetCamPos()):GetNormalized() local aimVector = (self:GetLookAt() - modeller.Finalized):GetNormalized()
do -- test 1, mins do -- test 1, mins
local entVector = mins - self:GetCamPos() local entVector = mins - modeller.Finalized
local angCos = aimVector:Dot(entVector) / entVector:Length() local angCos = aimVector:Dot(entVector) / entVector:Length()
S1 = (angCos >= directionAngCos) S1 = (angCos >= directionAngCos)
end end
do -- test 2: maxs do -- test 2: maxs
local entVector = maxs - self:GetCamPos() local entVector = maxs - modeller.Finalized
local angCos = aimVector:Dot(entVector) / entVector:Length() local angCos = aimVector:Dot(entVector) / entVector:Length()
S2 = (angCos >= directionAngCos) S2 = (angCos >= directionAngCos)
end end
if S1 and S2 then if S1 and S2 then
self.indicate = "took " .. i self.indicate = i
self.vCamPos:Add( Vector( 0, 20, 0 ) ) --modeller.Finalized:Add( Vector( 0, 20, 0 ) )
--self.vLookatPos:Add( Vector( 0, 0, 0 ) ) --self.vLookatPos:Add( Vector( 0, 0, 0 ) )
--self.vLookatPos:Set( (mins+maxs)/2 ) --self.vLookatPos:Set( (mins+maxs)/2 )
break break
else else
self.indicate = "failed" self.indicate = "failed"
self.vCamPos:Sub( (aimVector*20) ) modeller.Finalized:Sub( (aimVector*20) )
end end
end end end end
else else
@ -182,12 +212,14 @@ local function OpenDebugMenu()
self:DrawModel() self:DrawModel()
render.MaterialOverride() render.MaterialOverride()
local mins, maxs = self.Entity:GetCollisionBounds() if false and self.Entity:GetPhysicsObject():IsValid() then
local pos = self.Entity:GetPos()
-- render.SetColorMaterial() local mins, maxs = self.Entity:GetPhysicsObject():GetAABB()
-- render.DrawSphere( mins, .5, 30, 30, Color( 255, 0, 0 ) ) render.SetColorMaterial()
-- render.DrawSphere( maxs, .5, 30, 30, Color( 0, 0, 255 ) ) render.DrawSphere( pos+mins, .5, 30, 30, Color( 255, 0, 0 ) )
-- render.DrawWireframeBox( vector_origin, angle_zero, mins, maxs, Color( 0, 0, 0, 127 )) render.DrawSphere( pos+maxs, .5, 30, 30, Color( 0, 0, 255 ) )
render.DrawWireframeBox( pos, angle_zero, mins, maxs, Color( 0, 0, 0, 127 ))
end
render.SuppressEngineLighting( false ) render.SuppressEngineLighting( false )
cam.End3D() cam.End3D()
@ -195,15 +227,15 @@ local function OpenDebugMenu()
self.LastPaint = RealTime() self.LastPaint = RealTime()
end end
function modeller:Paint( w, h ) function modeller:Paint( w, h )
surface.SetDrawColor( color_black ) surface.SetDrawColor( HSLToColor( 0.9, 0.2, 0 ) )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
self:Paint1( w, h ) self:Paint1( w, h )
if self.Failed then if self.Failed then
draw.SimpleText("Failed physinit, not cached?", "HUD_36", w/2, h/2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText("Failed physinit, not cached?", "HUD_36", w/2, h/2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end end
-- if self.indicate then if self.indicate then
-- draw.SimpleText(self.indicate, "HUD_36", w/2, h/2 + 48, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(self.indicate, "HUD_16", 4, 4, color_white)
-- end end
end end
end end
@ -247,9 +279,40 @@ local function OpenDebugMenu()
end end
end end
local function OpenMyTeamMenu()
if IsValid(DebugMenu) then DebugMenu:Remove() end
DebugMenu = vgui.Create("DFrame")
DebugMenu:SetSize( 200, 300 )
DebugMenu:MakePopup()
DebugMenu:SetKeyboardInputEnabled( false )
DebugMenu:SetSizable(false)
for index, data in ipairs( TEAMS ) do
local faction = FACTIONS[ data.factionid ]
if !faction then continue end
local button = DebugMenu:Add("DButton")
button:Dock( TOP )
button:DockMargin( 0, 0, 0, 5 )
button:SetText( l8( data.name ) )
button.iIndex = index
button.iData = data
button.iFaction = faction
button:SetTall(28)
button.DoClick = doteamselect
button.Paint = painterly
end
DebugMenu:InvalidateLayout( true )
DebugMenu:SizeToChildren( false, true )
DebugMenu:Center()
end
hook.Add("PlayerButtonDown", "PlayerButtonDown_DebugMenu", function( ply, button ) hook.Add("PlayerButtonDown", "PlayerButtonDown_DebugMenu", function( ply, button )
if button == KEY_F1 then if button == KEY_F1 then
OpenDebugMenu() OpenDebugMenu()
elseif button == KEY_F2 then
OpenMyTeamMenu()
end end
end) end)

View File

@ -17,8 +17,6 @@ function BennyGame:GetType()
return cGametype:GetBool() and BG_GTYPE_MP or BG_GTYPE_CAMPAIGN return cGametype:GetBool() and BG_GTYPE_MP or BG_GTYPE_CAMPAIGN
end end
GM.TeamBased = BennyGame:GetType() == BG_GTYPE_MP
function BennyGame:GetMode() function BennyGame:GetMode()
return cGamemode:GetString() return cGamemode:GetString()
end end
@ -30,6 +28,10 @@ end
BennyGame.TeamsInPlay = { BennyGame.TeamsInPlay = {
4, 4,
3, 3,
--2,
--1,
--5,
--6,
} }
BennyGame.TeamCount = #BennyGame.TeamsInPlay BennyGame.TeamCount = #BennyGame.TeamsInPlay
@ -242,7 +244,6 @@ function BennyGame:EndRound( reason, forceteam )
if HighestScore < ThisScore then if HighestScore < ThisScore then
HighestScore = ThisScore HighestScore = ThisScore
HighestTeam = RealTeamID HighestTeam = RealTeamID
print("highest score to do it to em", HighestScore, TEAMS[HighestTeam].name)
winningteam = HighestTeam winningteam = HighestTeam
end end
end end
@ -251,9 +252,9 @@ function BennyGame:EndRound( reason, forceteam )
local ThisScore = BennyGame:GetScoreForTeam( RealTeamID ) local ThisScore = BennyGame:GetScoreForTeam( RealTeamID )
if RealTeamID == HighestTeam then continue end if RealTeamID == HighestTeam then continue end
if HighestScore < ThisScore then if HighestScore < ThisScore then
print("clearly there's been a failure", RealTeamID, ThisScore, HighestTeam, HighestScore) -- print("clearly there's been a failure", RealTeamID, ThisScore, HighestTeam, HighestScore)
elseif HighestScore == ThisScore then elseif HighestScore == ThisScore then
print("this looks like a tie", RealTeamID, HighestTeam) -- print("this looks like a tie", RealTeamID, HighestTeam)
winningteam = 0 winningteam = 0
break break
end end
@ -272,7 +273,14 @@ function BennyGame:EndRound( reason, forceteam )
PrintMessage(HUD_PRINTCENTER, TheFull) PrintMessage(HUD_PRINTCENTER, TheFull)
local roundtime = CurTime() - BennyGame:GetRoundStartedAt() local roundtime = CurTime() - BennyGame:GetRoundStartedAt()
print( "That round lasted " .. math.ceil(roundtime) .. " seconds." )
local rf = string.FormattedTime( 269 )
local nicely = ""
if rf.h > 0 then
nicely = nicely .. rf.h .. ":"
end
nicely = nicely .. string.format( "%02i:%02i.", rf.m, rf.s )
print( "That round lasted " .. nicely )
end end
concommand.Add("b-cheat_scoreset", function( ply, cmd, args ) concommand.Add("b-cheat_scoreset", function( ply, cmd, args )

View File

@ -119,7 +119,7 @@ local function regenfonts()
end end
regenfonts() regenfonts()
local FACTIONS = { FACTIONS = {
["benny"] = { ["benny"] = {
COLOR_MAIN = Color( 255, 238, 169 ), COLOR_MAIN = Color( 255, 238, 169 ),
COLOR_DARK = Color( 54, 44, 39 ), COLOR_DARK = Color( 54, 44, 39 ),
@ -428,7 +428,7 @@ function GM:HUDPaint()
local wep = handler:GetActiveR() local wep = handler:GetActiveR()
if wep and wep.GetClip then if wep and wep.GetClip then
local Bw, Bh = 328, 160 local Bw, Bh = 8+(8+2)*30-2+8, 160
S_Push( w - 20 - Bw, h - 20 - Bh ) S_Push( w - 20 - Bw, h - 20 - Bh )
hCol( COLOR_DARK ) hCol( COLOR_DARK )
hRect( 0, 0, Bw, Bh ) hRect( 0, 0, Bw, Bh )
@ -689,11 +689,11 @@ function GM:HUDPaint()
if TITLE!="SECURE" then if TITLE!="SECURE" then
S_Push( -BWIDE/2, 62 ) S_Push( -BWIDE/2, 62 )
hCol( obj:GetContested() and CONTOLER_DARK or COLOR_DARK ) hCol( TAKCOLOR_DARK )
hRect( 0, 0, 180, BTALL ) hRect( 0, 0, 180, BTALL )
hCol( obj:GetContested() and CONTOLER_MAIN or COLOR_MAIN ) hCol( TAKCOLOR_MAIN )
hORect( 1, 1, 180-2, BTALL-2 ) hORect( 1, 1, 180-2, BTALL-2 )
hCol( obj:GetContested() and CONTOLER_MAIN or TITLE=="CLEARING" and TAKCOLOR_MAIN or COLOR_MAIN ) hCol( TAKCOLOR_MAIN )
hRect( 3, 3, math.floor((BWIDE-6) * PERCENT), BTALL-6 ) hRect( 3, 3, math.floor((BWIDE-6) * PERCENT), BTALL-6 )
S_Pop() S_Pop()
local x, y = hXY( 0, 78 ) local x, y = hXY( 0, 78 )

View File

@ -218,7 +218,9 @@ AddItem( "base_firearm", {
p:LagCompensation(false) p:LagCompensation(false)
local ply = handler:GetOwner() local ply = handler:GetOwner()
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true ) if SERVER or CLIENT and IsFirstTimePredicted() then
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true )
end
ent:PlayAnimation( ent:LookupSequence("fire") ) ent:PlayAnimation( ent:LookupSequence("fire") )
end, end,
@ -237,14 +239,18 @@ AddItem( "base_firearm", {
handler:EmitSound( class.MagOutSound, 70, 100, 0.4, CHAN_STATIC ) handler:EmitSound( class.MagOutSound, 70, 100, 0.4, CHAN_STATIC )
ent:SetLoaded( false ) ent:SetLoaded( false )
ent:SetClip( 0 ) ent:SetClip( 0 )
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true ) if SERVER or CLIENT and IsFirstTimePredicted() then
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true )
end
time = 0.4 time = 0.4
ent:PlayAnimation( ent:LookupSequence("magout") ) ent:PlayAnimation( ent:LookupSequence("magout") )
else else
handler:EmitSound( class.MagInSound, 70, 100, 0.4, CHAN_STATIC ) handler:EmitSound( class.MagInSound, 70, 100, 0.4, CHAN_STATIC )
ent:SetLoaded( true ) ent:SetLoaded( true )
ent:SetRefillTime( CurTime() + 0.5 ) ent:SetRefillTime( CurTime() + 0.5 )
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_insert"][class.HoldType] ), 0, true ) if SERVER or CLIENT and IsFirstTimePredicted() then
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_insert"][class.HoldType] ), 0, true )
end
time = 0.8 time = 0.8
ent:PlayAnimation( ent:LookupSequence("magin") ) ent:PlayAnimation( ent:LookupSequence("magin") )
end end
@ -256,7 +262,9 @@ AddItem( "base_firearm", {
ent:SetDelay( CurTime() + 0.5 ) ent:SetDelay( CurTime() + 0.5 )
local ply = handler:GetOwner() local ply = handler:GetOwner()
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["deploy"][class.HoldType] ), 0, true ) if SERVER or CLIENT and IsFirstTimePredicted() then
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["deploy"][class.HoldType] ), 0, true )
end
end, end,
["Holster"] = function( class, ent, handler ) ["Holster"] = function( class, ent, handler )
@ -266,7 +274,9 @@ AddItem( "base_firearm", {
ent:SetDelay( CurTime() + 0.25 ) ent:SetDelay( CurTime() + 0.25 )
local ply = handler:GetOwner() local ply = handler:GetOwner()
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["holster"][class.HoldType] ), 0, true ) if SERVER or CLIENT and IsFirstTimePredicted() then
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["holster"][class.HoldType] ), 0, true )
end
end, end,
}) })
@ -658,6 +668,31 @@ do -- Rifles
end end
do -- MGs
AddItem( "qbb", {
PrintName = "#Item.qbb.Name",
Description = "#Item.qbb.Description",
Category = "machinegun",
Base = "base_firearm",
Model = "models/benny/weapons/test_qbb.mdl",
HoldType = "rifle",
ClipSize = 75,
Delay = (60/750),
FireSound = {
"benny/weapons/stoner63/01.ogg",
"benny/weapons/stoner63/02.ogg",
"benny/weapons/stoner63/03.ogg",
},
Accuracy = 1,
Accuracy_Add = 0.4,
Accuracy_Reset = 0.4,
Accuracy_Decay = 12,
})
end
do -- SMGs do -- SMGs
AddItem( "tmp", { AddItem( "tmp", {

View File

@ -32,6 +32,9 @@ L["#Item.fnc.Description"] = "Imported assault rifle"
L["#Item.qbz.Name"] = "QBZ-95" L["#Item.qbz.Name"] = "QBZ-95"
L["#Item.qbz.Description"] = "Low-profile bullpup assault rifle" L["#Item.qbz.Description"] = "Low-profile bullpup assault rifle"
L["#Item.qbb.Name"] = "QBB-LSW"
L["#Item.qbb.Description"] = "Bullpup machine gun"
L["#Item.m16a2.Name"] = "M16A2" L["#Item.m16a2.Name"] = "M16A2"
L["#Item.m16a2.Description"] = "Rugged burst rifle" L["#Item.m16a2.Description"] = "Rugged burst rifle"

View File

@ -368,7 +368,9 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
ply:SetGroundEntity( NULL ) ply:SetGroundEntity( NULL )
ply:SetInDive( true ) ply:SetInDive( true )
ply:SetDivedAt( CurTime() ) ply:SetDivedAt( CurTime() )
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_start_handgun" ), 0, true ) if SERVER or CLIENT and IsFirstTimePredicted() then
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_start_handgun" ), 0, true )
end
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
local rfil = nil local rfil = nil
if SERVER then if SERVER then
@ -378,8 +380,6 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
end end
ply:EmitSound("weapons/slam/throw.wav", 70, 100, .25, nil, nil, nil, rfil) ply:EmitSound("weapons/slam/throw.wav", 70, 100, .25, nil, nil, nil, rfil)
end end
ply:SetHull( Vector( -8, -8, 32 ), Vector( 8, 8, 72 ) )
ply:SetHullDuck( Vector( -8, -8, 32 ), Vector( 8, 8, 48 ) )
end end
if ply:OnGround() and ply:GetInDive() then if ply:OnGround() and ply:GetInDive() then
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
@ -393,12 +393,11 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
end end
ply:SetInDive(false) ply:SetInDive(false)
ply:SetDivedAt( CurTime() ) ply:SetDivedAt( CurTime() )
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_end_handgun" ), 0, true ) if SERVER or CLIENT and IsFirstTimePredicted() then
ply:SetHull( Vector( -8, -8, 0 ), Vector( 8, 8, 72 ) ) ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_end_handgun" ), 0, true )
ply:SetHullDuck( Vector( -8, -8, 0 ), Vector( 8, 8, 48 ) ) end
mv:SetVelocity( mv:GetVelocity() + Vector( 0, 0, 120 ) ) mv:SetVelocity( mv:GetVelocity() + Vector( 0, 0, 120 ) )
ply:SetGroundEntity( NULL ) ply:SetGroundEntity( NULL )
mv:SetOrigin( mv:GetOrigin() + vector_up*32 )
end end
--if !ply:OnGround() and ply:GetInDive() then --if !ply:OnGround() and ply:GetInDive() then
-- local da = ply:GetDivedAt() -- local da = ply:GetDivedAt()

View File

@ -9,7 +9,7 @@ concommand.Add("b-cheat_setteam", function( ply, cmd, args )
print( index .. " - " .. data.id ) print( index .. " - " .. data.id )
end end
else else
ply:SetTeam( TEAMS_IDorName( args[1] ) ) ply:SetTeam( TEAMS_IDorName( tonumber(args[1]) or args[1] ) )
end end
end, function( cmd, args ) end, function( cmd, args )
return BENNY.SimpleAutoComplete( cmd, args, TEAMS_IDs ) return BENNY.SimpleAutoComplete( cmd, args, TEAMS_IDs )