Oh my god I need to rewrite MORE

This commit is contained in:
Fesiug 2024-03-07 20:27:18 -05:00
parent 35ba698d27
commit b1d6191469
Signed by: Fesiug
GPG Key ID: 374BFF45E1EEF243
13 changed files with 77 additions and 433 deletions

View File

@ -43,6 +43,8 @@ if CLIENT then -- CL CL CL
CONVARS_CL = {}
CONVARS_CL["lang"] = { "en-us", nil, nil, false, true, "Active language" }
CONVARS_CL["hud_scale"] = { 2, 1, 4, false, true, "HUD integer scaling" }
CONVARS_CL["hud_tempactive"] = { "benny", nil, nil, false, true, "HUD color scheme temporary" }

View File

@ -12,7 +12,7 @@ local function regen_items( itemlist )
for i, v in pairs( ply:INV_ListFromBuckets() ) do
local class = inv[v].Class
local Class = WeaponGet(class)
local Class = ITEMS[class]
if !catesmade[Class.Category] then
catesmade[Class.Category] = true

View File

@ -21,7 +21,7 @@ end
local mewer = {
{
Func = function( class )
return class.Name
return class.PrintName
end,
Size = 18,
SizeMultiline = 18,
@ -279,8 +279,8 @@ function OpenSMenu()
surface.DrawRect( 0, 0, w, h )
if pan_active then
local rang = WeaponGet( pan_active )
draw.SimpleText( rang.Name, "Benny_18", ss(2), ss(2), schema_c("bg") )
local rang = ITEMS[ pan_active ]
draw.SimpleText( l8(rang.PrintName), "Benny_18", ss(2), ss(2), schema_c("bg") )
end
return true
end
@ -297,8 +297,8 @@ function OpenSMenu()
surface.DrawRect( 0, 0, w, h )
if pan_active then
local rang = WeaponGet( pan_active )
local multiline = multlinetext( rang.Description, w-ss(2), "Benny_12" )
local rang = ITEMS[ pan_active ]
local multiline = multlinetext( l8(rang.Description) or "No description", w-ss(2), "Benny_12" )
for i, v in ipairs( multiline ) do
local line = i-1
local height = ss( 14 + (#multiline-1)*12 )
@ -331,10 +331,10 @@ function OpenSMenu()
surface.DrawRect( 0, 0, w, h )
end
local rang = WeaponGet( pan_active )
local rang = ITEMS[ pan_active ]
if rang then
if us.SizeMultiline then
local multiline = multlinetext( us.Func and us.Func( rang ) or us.Name, w-ss(2), us.Font )
local multiline = multlinetext( l8( us.Func and us.Func( rang ) or us.PrintName ), w-ss(2), us.Font )
for i, v in ipairs( multiline ) do
local line = i-1
local height = ss( us.Size + ((#multiline-1)*us.SizeMultiline) )
@ -345,7 +345,7 @@ function OpenSMenu()
draw.SimpleText( v, us.Font, ss(2), ss(2)+ss(us.SizeMultiline*line), schema_c(us.Stat and "fg" or "bg") )
end
else
draw.SimpleText( us.Func and us.Func( rang ) or us.Name, us.Font, ss(2), ss(2), schema_c(us.Stat and "fg" or "bg") )
draw.SimpleText( l8( us.Func and us.Func( rang ) or us.PrintName ), us.Font, ss(2), ss(2), schema_c(us.Stat and "fg" or "bg") )
end
if us.Stat then
local perc = us.Stat( rang )
@ -385,7 +385,7 @@ function OpenSMenu()
function fucker:Paint( w, h )
do return true end
if pan_active then
local hm = WeaponGet( pan_active )
local hm = ITEMS[ pan_active ]
surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h )
@ -403,7 +403,7 @@ function OpenSMenu()
function fucker:Paint( w, h )
do return true end
if pan_active then
local hm = WeaponGet( pan_active )
local hm = ITEMS[ pan_active ]
surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h )
@ -431,13 +431,14 @@ function OpenSMenu()
local createlist = {}
for ClassName, Class in pairs( WEAPONS ) do
for ClassName, Class in pairs( ITEMS ) do
if rawget(Class, "Hide") then continue end
if !createlist[Class.Category] then
createlist[Class.Category] = {}
local category = Class.Category or "No category"
if !createlist[category] then
createlist[category] = {}
end
table.insert( createlist[Class.Category], { ClassName = ClassName, Class = Class } )
table.insert( createlist[category], { ClassName = ClassName, Class = Class } )
end
for i, v in SortedPairs( createlist ) do
@ -452,19 +453,19 @@ function OpenSMenu()
button:SetSize( 0, ss(10) )
button:DockMargin( 0, 0, 0, ss(0) )
button.Text_Name = New.Class.Name
button.Text_Desc = New.Class.Description
button.Text_Name = l8( New.Class.PrintName )
button.Text_Desc = l8( New.Class.Description )
-- PROTO: These functions don't need to be remade over and over like this.
function button:DoClick()
RunConsoleCommand( "benny_debug_give", New.ClassName )
chat.AddText( "Gave " .. New.Class.Name )
chat.AddText( "Gave " .. New.Class.PrintName )
end
function button:DoRightClick()
if ItemDef("mag_"..New.ClassName) then
RunConsoleCommand( "benny_debug_give", "mag_" .. New.ClassName )
chat.AddText( "Gave " .. ItemDef("mag_"..New.ClassName).Name )
chat.AddText( "Gave " .. ItemDef("mag_"..New.ClassName).PrintName )
else
chat.AddText( "That item doesn't exist. " .. "mag_"..New.ClassName )
end

View File

@ -36,6 +36,8 @@ end
AddItem( "base", {
PrintName = "Base Item",
Description = "Beginning item base.",
Category = "base",
Vars = {
["Float"] = {
@ -65,6 +67,8 @@ AddItem( "base", {
AddItem( "base_firearm", {
PrintName = "Base Firearm",
Description = "Item base for firearms.",
Category = "base",
Base = "base",
Vars = {
@ -100,7 +104,9 @@ AddItem( "base_firearm", {
})
AddItem( "mk23", {
PrintName = "MK.23",
PrintName = "#Item.mk23.Name",
Description = "#Item.mk23.Description",
Category = "pistol",
Base = "base_firearm",
Model = "models/weapons/w_pist_usp.mdl",

View File

@ -0,0 +1,7 @@
local L = {}
Languages["en-us"] = L
L["Name"] = "English (United States)"
L["#Item.mk23.Name"] = "MK.23"
L["#Item.mk23.Description"] = "Special forces sidearm"

View File

@ -0,0 +1,10 @@
Languages = {}
function l8( inp )
return Languages[ConVarCL_String("lang")][inp] or Languages["en-us"][inp] or inp
end
local AD, IN = AddCSLuaFile, include
AD("en-us.lua")
IN("en-us.lua")

View File

@ -1,203 +1,6 @@
--
local debugcolor = Color( 255, 0, 255, 1 )
local function QuickDrag( self, dist, ply )
local spos = ply:GetPos()
self.QuickDrag = self.QuickDrag or Vector()
-- debugoverlay.Box( self.last, Vector( -dist, -dist, 0 ), Vector( dist, dist, 64 ), 0, Color( 0, 0, 255, 0 ) )
if spos.x > (self.QuickDrag.x+dist) then
self.QuickDrag.x = spos.x-dist
elseif spos.x < (self.QuickDrag.x-dist) then
self.QuickDrag.x = spos.x+dist
end
if spos.y > (self.QuickDrag.y+dist) then
self.QuickDrag.y = spos.y-dist
elseif spos.y < (self.QuickDrag.y-dist) then
self.QuickDrag.y = spos.y+dist
end
return spos
end
tempmapcameras = {}
tempmapcameras["benny_caramelldansen"] = {}
tempmapcameras["benny_caramelldansen"]["main"] = {
Type = "Standard",
Pos = Vector( -510, 0, 128 ),
Ang = Angle( 44, 0, 0 ),
FOV = 90,
Checks = {
{
Vector( -512, -512, 64 ),
Vector( 512, 512, -64 ),
},
},
Special = function( self, ply )
local pos = Vector()
pos:Set( self.Pos )
local ang = Angle()
ang:Set( self.Ang )
pos:Set( QuickDrag( self, 40, ply ) )
pos.x = pos.x - 130
pos.z = 180
return pos, ang, self.FOV
end
}
tempmapcameras["benny_test"] = {}
tempmapcameras["benny_test"]["main"] = {
Type = "Standard",
Pos = Vector( -692, 0, 268 ),
Ang = Angle( 55, 0, 0 ),
FOV = 90,
Checks = {
{
Vector( -390, 510, 0 ),
Vector( -924, -509, -90 ),
},
},
iX1 = -550,
iX2 = -800,
Special = function( self, ply )
local pos = Vector()
pos:Set( self.Pos )
local ang = Angle()
ang:Set( self.Ang )
local ppos = ply:GetPos()
pos.y = ppos.y
do -- Angle
local amt = math.TimeFraction( self.iX1, self.iX2, ppos.x )
debugoverlay.Line( Vector( self.iX1, 0, 0 ), Vector( self.iX2, 0, 0 ), 0, debugcolor, true )
amt = math.Clamp( amt, 0, 1 )
amt = math.ease.InOutCubic( amt )
ang.p = ang.p + ( 25 * (amt) )
pos.x = pos.x - ( 170 * (amt) )
end
return pos, ang, self.FOV
end
}
tempmapcameras["benny_test"]["grass"] = {
Pos = Vector( -1622, -214, 284 ),
Ang = Angle( 70, 0, 0 ),
FOV = 90,
Checks = {
{
Vector( -931, -130, 0 ),
Vector( -1311, -319, -70 ),
},
{
Vector( -1321, 506, 0 ),
Vector( -1813, -503, -70 ),
},
},
iX1 = -900,
iX2 = -1330,
iX3 = -1400,
iX4 = -1750,
Special = function( self, ply )
local pos = Vector()
pos:Set( self.Pos )
local ang = Angle()
ang:Set( self.Ang )
local fov = self.FOV
local ppos = ply:GetPos()
pos.y = ppos.y
do -- far
local amt = math.TimeFraction( self.iX1, self.iX2, ppos.x )
debugoverlay.Line( Vector( self.iX1, ppos.y, ppos.z ), Vector( self.iX2, ppos.y, ppos.z ), 0, debugcolor, true )
amt = 1-math.Clamp( amt, 0, 1 )
amt = math.ease.InOutSine( amt )
ang.p = ang.p - ( 11 * amt )
pos.x = pos.x + ( 400 * amt )
fov = fov - ( 22 * amt )
end
do -- close
local amt = math.TimeFraction( self.iX3, self.iX4, ppos.x )
debugoverlay.Line( Vector( self.iX3, ppos.y, ppos.z ), Vector( self.iX4, ppos.y, ppos.z ), 0, debugcolor, true )
amt = math.Clamp( amt, 0, 1 )
amt = math.ease.InOutCubic( amt )
pos.x = pos.x - ( 150 * (amt) )
ang.p = ang.p + ( 0 * (amt) )
end
return pos, ang, fov
end
}
tempmapcameras["benny_test"]["barber"] = {
Pos = Vector( -64, 0, 80 ),
Ang = Angle( 34, 0, 0 ),
FOV = 90,
Checks = {
{
Vector( -382, 128, 0 ),
Vector( 128, -128, -70 ),
},
},
Special = function( self, ply )
local pos = Vector()
pos:Set( self.Pos )
local ang = Angle()
ang:Set( self.Ang )
local fov = self.FOV
local ppos = ply:GetPos()
pos.x = pos.x + ppos.x
pos.y = pos.y + ppos.y
pos.x = math.max( pos.x, -400 )
return pos, ang, fov
end
}
BENNY_ACTIVECAMERA = nil
local si = 4
local ctrace = {
start = nil,
endpos = nil,
mins = Vector( -si, -si, -si ),
maxs = Vector( si, si, si ),
mask = MASK_SHOT_HULL,
filter = nil,
}
local tempcam = {
FOV = 90,
Special = function( self, ply )
local pos = Vector()
local ang = Angle( 22, 0, 0 )
pos:Set( QuickDrag( self, 40, ply ) )
pos.x = pos.x - 30
pos.z = pos.z + 80
return pos, ang, self.FOV
end
}
local fixer = Angle( 0, -90, 90 )
local fixer2 = Angle( 0, -90, 90 )
local cscam = {
@ -236,9 +39,6 @@ local cscam = {
}
local function decide_active()
-- print( LocalPlayer():GetPos() )
-- BENNY_ACTIVECAMERA = tempcam
local csent = ents.FindByClass( "benny_cutscene" )[1]
if IsValid( csent ) then
BENNY_ACTIVECAMERA = cscam
@ -246,19 +46,6 @@ local function decide_active()
return true
end
if tempmapcameras[ game.GetMap() ] then
for name, camera in pairs( tempmapcameras[ game.GetMap() ] ) do
if camera.Checks then
for i, v in ipairs(camera.Checks) do
-- debugoverlay.Box( vector_origin, v[1], v[2], 0, debugcolor )
if LocalPlayer():GetPos():WithinAABox( v[1], v[2] ) then
BENNY_ACTIVECAMERA = camera
return true
end
end
end
end
end
return false
end
@ -291,11 +78,11 @@ hook.Add( "CalcView", "Benny_CalcView", function( ply, pos, ang, fov )
local wep = ply:BennyCheck()
if wep then -- and ply:GetActiveWeapon():GetAim() > 0 then
local cv = wep:bWepClass( true ) and wep:bWepClass( true ).Custom_CalcView or wep:bWepClass( false ) and wep:bWepClass( false ).Custom_CalcView
--local cv = wep:bWepClass( true ) and wep:bWepClass( true ).Custom_CalcView or wep:bWepClass( false ) and wep:bWepClass( false ).Custom_CalcView
local halt = false
if cv then
halt = cv( wep, view, view.origin, view.angles, view.fov )
end
--if cv then
-- halt = cv( wep, view, view.origin, view.angles, view.fov )
--end
if !halt then
view.drawviewer = true
view.origin, view.angles, view.fov = bennyfp( view.origin, view.angles, view.fov )
@ -333,177 +120,6 @@ function Convert( fovDegrees, ratio )
return retDegrees * 2
end
concommand.Add("benny_cam_panel", function()
if IsValid( CamPanel ) then CamPanel:Remove() end
CamPanel = vgui.Create( "DFrame" )
local a = CamPanel
a:SetSize( 320, 280 )
a:Center()
a:MakePopup()
local st = c_over:GetString()
if st == "" then
st = "0 0 0 0 0 0 90"
end
st = string.Explode( " ", st )
for i=1, 3 do
local t = a:Add("DLabel")
t:SetSize( 300, 14 )
t:DockMargin( 20, 2, 20, 2 )
t:Dock( TOP )
t:SetText( i==1 and "Hold CONTROL to Right/Forward/Up" or
i==2 and "Hold SHIFT to multiply 10x" or
i==3 and "Hold ALT to multiply 2x" )
end
local bloink = {}
for i=1, 3 do
local b = vgui.Create("DNumberWang")
bloink[i] = b
b:SetSize( 200, 20 )
b:DockMargin( 20, 2, 20, 2 )
b:SetText( st[i] )
b:SetMinMax( -math.huge, math.huge )
b.OnValueChanged = function(self)
st[i] = self:GetValue()
c_over:SetString( table.concat( st, " " ) )
end
local d = vgui.Create("DPanel")
for u=1, 6 do
local bu = d:Add("DButton")
bu:Dock( LEFT )
bu:SetSize( 29, 24 )
bu:DockMargin( 0, 0, 2, 0 )
local wa = 0
if u==1 then
wa = -10
elseif u==2 then
wa = -5
elseif u==3 then
wa = -1
elseif u==4 then
wa = 1
elseif u==5 then
wa = 5
elseif u==6 then
wa = 10
end
bu:SetText( wa )
function bu:DoClick( )
local wa = wa
if input.IsKeyDown( KEY_LALT ) then
wa = wa * 2
end
if input.IsKeyDown( KEY_LSHIFT ) then
wa = wa * 10
end
if input.IsKeyDown( KEY_LCONTROL ) then
local wawa = Vector()
local new = Angle( st[4], st[5], st[6] )
wawa = i==1 and new:Right() or i==2 and new:Forward() or new:Up()
wawa:Mul(wa)
st[1] = st[1] + wawa[1]
st[2] = st[2] + wawa[2]
st[3] = st[3] + wawa[3]
bloink[1]:SetValue( st[1] )
bloink[2]:SetValue( st[2] )
bloink[3]:SetValue( st[3] )
return
end
b:SetValue( b:GetValue() + wa )
end
end
local c = a:Add("DHorizontalDivider")
c:Dock( TOP )
c:DockMargin( 10, 0, 10, 0 )
c:SetLeft(b)
c:SetRight(d)
end
for i=1, 3 do
local b = a:Add("DNumSlider")
bloink[i+3] = b
b:SetSize( 200, 20 )
b:Dock( TOP )
b:DockMargin( 20, 2, 20, 2 )
b:SetText( i==1 and "Pitch" or i==2 and "Yaw" or "Roll" )
b:SetMin( -360 )
b:SetMax( 360 )
b:SetValue( st[i+3] )
b:SetDecimals( 1 )
b.OnValueChanged = function( self, val )
val = math.NormalizeAngle( val )
self:SetValue( val )
st[i+3] = val
c_over:SetString( table.concat( st, " " ) )
end
end
do
local b = a:Add("DNumSlider")
bloink[7] = b
b:SetSize( 200, 20 )
b:Dock( TOP )
b:DockMargin( 20, 2, 20, 2 )
b:SetText( "Field of View" )
b:SetMin( 0 )
b:SetMax( 90 )
b:SetValue( st[7] )
b.OnValueChanged = function(self)
st[7] = self:GetValue()
c_over:SetString( table.concat( st, " " ) )
end
end
do
local b = vgui.Create("DButton")
b:SetText( "Steal from current" )
function b:DoClick()
local ply = LocalPlayer()
local ppos = ply:EyePos()
local pang = ply:EyeAngles()
for i=1, 7 do
if i==1 then
bloink[i]:SetValue( ppos[1] )
elseif i==2 then
bloink[i]:SetValue( ppos[2] )
elseif i==3 then
bloink[i]:SetValue( ppos[3] )
elseif i==4 then
bloink[i]:SetValue( pang[1] )
elseif i==5 then
bloink[i]:SetValue( pang[2] )
elseif i==6 then
bloink[i]:SetValue( pang[3] )
elseif i==7 then
bloink[i]:SetValue( 90 )
end
c_over:SetString( table.concat( st, " " ) )
end
end
local d = vgui.Create("DButton")
d:SetText( "Reset" )
function d:DoClick()
for i=1, 7 do
bloink[i]:SetValue( i==7 and 90 or 0 )
end
c_over:SetString("")
end
local c = a:Add("DHorizontalDivider")
c:Dock( TOP )
c:DockMargin( 10, 0, 10, 0 )
c:SetLeft(b)
c:SetRight(d)
end
end)
concommand.Add( "benny_dev_eyetrace", function( ply )
local tr = ply:GetEyeTrace()
print( string.format("Vector( %i, %i, %i )", math.Round( tr.HitPos.x ), math.Round( tr.HitPos.y ), math.Round( tr.HitPos.z ) ) )

View File

@ -483,7 +483,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
end
if wep and ConVarCL_Bool("hud_enable_active") then -- Weapon
if false and wep and ConVarCL_Bool("hud_enable_active") then -- Weapon
local inv = p:INV_Get()
local wep1 = wep:bWepTable( false )
local wep1c = wep:bWepClass( false )
@ -577,7 +577,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
surface.DrawOutlinedRect( m_x + bb - chunk, m_y + bb, m_w - b2, m_h - b2, ss( 0.5 ) )
local s1 = (m_h - b2 - b2)
local s2 = (m_h - b2 - b2) * (inv[tag] and ( inv[tag].Ammo / WeaponGet(inv[tag].Class).Ammo ) or 8)
local s2 = (m_h - b2 - b2) * (inv[tag] and ( inv[tag].Ammo / ITEMS[inv[tag].Class].Ammo ) or 8)
local s3 = math.floor( s2 - s1 )
local m1, m2, m3, m4 = m_x + bb + bb - chunk, m_y + bb + bb - s3, m_w - b2 - b2, s2
@ -600,7 +600,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
end
end
if wep then -- Crosshair
if false and wep then -- Crosshair
local dispersion = math.rad( 1 )
cam.Start3D()
@ -710,7 +710,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
end
if wep and ConVarCL_Bool("hud_enable_hotbar") then -- Newinv
if false and wep and ConVarCL_Bool("hud_enable_hotbar") then -- Newinv
local weighted = p:INV_Weight()
local inv = p:INV_Get()
local iflip = table.Flip( p:INV_Get())
@ -726,7 +726,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
local num, tcount = 0, table.Count( weighted )
for _, item in pairs( weighted ) do
num = num + 1
local class = WeaponGet(item.Class)
local class = ITEMS[item.Class]
local boxsize = ss(b_w)
fbump = fbump + boxsize
if num != tcount then
@ -741,7 +741,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
local active = wep:bGetReqInvID( false ) == id or wep:bGetReqInvID( true ) == id
local active_r = wep:bGetReqInvID( false ) == id
local active_l = wep:bGetReqInvID( true ) == id
local class = WeaponGet(item.Class)
local class = ITEMS[item.Class]
local boxsize = ss(b_w)
surface.SetDrawColor( scheme[active and "fg" or "bg"] )
surface.DrawRect( b_x + bump, b_y, boxsize, ss(b_h) )
@ -770,7 +770,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
local mitem = inv[mag]
if !mitem then continue end
local loaded = (item.Loaded == mag)
local perc = mitem.Ammo/WeaponGet(mitem.Class).Ammo
local perc = mitem.Ammo/ITEMS[mitem.Class].Ammo
surface.SetDrawColor( scheme["bg"] )
surface.DrawRect( b_x + bump + magbump + ss(13), b_y - ss(14), ss(3), ss(12) )
surface.SetDrawColor( scheme["fg"] )
@ -934,7 +934,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
end
end
if true and wep then
if false and wep then
local bump1 = ss(1)
local bump2 = ss(1)
local bump4 = ss(2)

View File

@ -42,7 +42,7 @@ end,
function(cmd, args)
args = string.Trim(args:lower())
local meow = {}
for i, v in SortedPairs( WEAPONS ) do
for i, v in SortedPairs( ITEMS ) do
if string.lower(i):find(args) then
table.insert( meow, cmd .. " " .. i )
end

View File

@ -24,7 +24,7 @@ local function beatup( ply, num )
local invid = 0
if CLIENT and !IsFirstTimePredicted() then return end
for _, item in pairs( weighted ) do
local class = WeaponGet(item.Class)
local class = ITEMS[item.Class]
local id = iflip[item]
if class.Equipable or class.Features == "firearm" or class.Features == "grenade" or class.Features == "melee" then
invid = invid + 1

View File

@ -24,8 +24,8 @@ hook.Add( "InputMouseApply", "Benny_InputMouseApply", function( cmd, x, y, ang )
local p = LocalPlayer()
local w = p:BennyCheck()
local cdis = false
if w and w:bWepClass( false ) and w:bWepClass( false ).Custom_DisableSpecialMovement and w:bWepClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end
if w and w:bWepClass( true ) and w:bWepClass( true ).Custom_DisableSpecialMovement and w:bWepClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end
if false and w and w:bWepClass( false ) and w:bWepClass( false ).Custom_DisableSpecialMovement and w:bWepClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end
if false and w and w:bWepClass( true ) and w:bWepClass( true ).Custom_DisableSpecialMovement and w:bWepClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end
if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end
if p:NoclippingAndNotVaulting() then cdis = true end
if w and !cdis and (y!=0 or x!=0) then
@ -82,14 +82,14 @@ hook.Add( "CreateMove", "Benny_CreateMove", function( cmd )
local p = LocalPlayer()
local w = p:BennyCheck()
local cdis = false
if w then
if w:bWepClass( false ) and w:bWepClass( false ).Custom_DisableSpecialMovement and w:bWepClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end
if w:bWepClass( true ) and w:bWepClass( true ).Custom_DisableSpecialMovement and w:bWepClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end
end
--if w then
-- if w:bWepClass( false ) and w:bWepClass( false ).Custom_DisableSpecialMovement and w:bWepClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end
-- if w:bWepClass( true ) and w:bWepClass( true ).Custom_DisableSpecialMovement and w:bWepClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end
--end
if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end
if LocalPlayer():NoclippingAndNotVaulting() then cdis = true end
if w and !cdis then -- FPS cam
local aimed = w:GetUserAim()
local aimed = false--w:GetUserAim()
local opos, ang = p:CamSpot( TPSOverride )
local lx=input.GetAnalogValue(ANALOG_JOY_X) // Left X Axis: left -, right +

View File

@ -163,7 +163,7 @@ hook.Add( "Move", "Benny_Move", function( ply, mv )
local w = ply:BennyCheck()
local hand = false
if w and w:bWepClass( hand ) then
if false and w and w:bWepClass( hand ) then
local targetspeed = mv:GetMaxSpeed()
targetspeed = targetspeed * w:GetStat( hand, "Speed_Move" )

View File

@ -3,7 +3,7 @@ function GM:PlayerSpawn( ply )
player_manager.SetPlayerClass( ply, "player_benny" )
ply:SetViewOffset( Vector( 0, 0, 64 ) )
ply:SetViewOffsetDucked( Vector( 0, 0, 50 ) )
ply:Give( "benny" )
ply:Give( "itemhandler" )
ply:SetStamina( 1 )
@ -119,15 +119,17 @@ end
function PT:BennyCheck()
local wep = self:GetActiveWeapon()
return ( wep:IsValid() and wep:GetClass() == "benny" and wep.GetUserAim ) and wep or false
return ( wep:IsValid() and wep:GetClass() == "itemhandler" and wep.GetActiveR ) and wep or false
end
function PT:CamSpot( ang )
local w = self:GetActiveWeapon()
if !IsValid( w ) then w = false end
local aim = w and w:GetAim() or 0
if w then aim = w:GetUserAim() and math.ease.OutCubic( aim ) or math.ease.InCubic( aim ) end
--local aim = w and w:GetAim() or 0
--if w then aim = w:GetUserAim() and math.ease.OutCubic( aim ) or math.ease.InCubic( aim ) end
local aim = 0
local pos = self:GetPos()
@ -207,8 +209,8 @@ function PT:INV_Weight()
local inv = self:INV_Get()
local results = {}
for i, v in pairs( inv ) do
if WeaponGet(v.Class).Features != "magazine" then
table.insert( results, { inv[i], WeaponGet(v.Class) } )
if ITEMS[v.Class].Features != "magazine" then
table.insert( results, { inv[i], ITEMS[v.Class] } )
end
end
-- PROTO: HOLY SHIT THIS SUCKS, MAKES A FUNCTION AND MIGHT RUN EVERY FRAME!!!
@ -295,7 +297,7 @@ do
for i, bucket in ipairs( inventorylist ) do
local temp = {}
for id, data in pairs( inv ) do
local idata = WeaponGet(data.Class)
local idata = ITEMS[data.Class]
local translated = translat[idata.Category]
if i == translated[1] then