Fixed item model bug

master
AlmTech Software 5 years ago
parent 48dde3981b
commit 7667e9ed9e
  1. 10
      entities/entities/q_item/init.lua
  2. 4
      gamemode/engine/core/sh_player_binds.lua
  3. 2
      gamemode/engine/derma/menus/menu_charinfo.lua
  4. 6
      gamemode/engine/lib/server/sv_inventory.lua
  5. 3
      gamemode/engine/lib/server/sv_networking.lua
  6. 12
      gamemode/settings/sh_items.lua

@ -12,7 +12,6 @@ include( "shared.lua" )
function ENT:Initialize()
self:SetModel( "models/props_phx/gears/bevel12.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
@ -34,3 +33,12 @@ function ENT:Use( activator, caller )
end
end
end
function ENT:InitializeItem( itemid, amount )
self:SetModel( Quantum.Item.Get( itemid).model )
self.itemid = itemid
self.amount = amount
self:SetNWString( "q_item_id", itemid )
self:SetNWInt( "q_item_amount", amount )
end

@ -17,5 +17,9 @@ if SERVER then
function GM:KeyRelease( ply, key )
if( keyfuncs[key] ) then keyfuncs[key]( ply ) end
end
function GM:ShowHelp( ply )
keyfuncs["mainMenu"]( ply )
end
end

@ -276,7 +276,7 @@ function menu.open( dt )
end
end
hook.Add("ScoreboardShow", "Quantum_Menu_CharInfo_Open", function() --Quantum.Server.Inventory.GiveItem( Entity(1), "test2", 21 )
hook.Add("ScoreboardShow", "Quantum_Menu_CharInfo_Open", function()
-- if( InventoryStartTime == nil ) then
-- InventoryStartTime = CurTime()
-- end

@ -221,10 +221,9 @@ function Quantum.Server.Inventory.DropItem( pl, index, amount ) -- Quantum.Serve
-- spawn the item infront of the player
local itemEnt = ents.Create( "q_item" )
if( IsValid( itemEnt ) ) then
itemEnt:SetModel( item.model )
itemEnt:SetPos( pl:GetPos() + ( pl:GetForward() * 40 ) + Vector( 0, 0, 40 ) )
itemEnt.amount = amount
itemEnt.itemid = itemid
itemEnt:InitializeItem( itemid, amount )
itemEnt:Spawn()
timer.Simple( math.Clamp( Quantum.Server.Settings.ItemDespawnTimer, 1, 600 ), function()
@ -233,6 +232,7 @@ function Quantum.Server.Inventory.DropItem( pl, index, amount ) -- Quantum.Serve
itemEnt:Remove()
end
end)
end
end
else

@ -165,9 +165,6 @@ end)
local function UpdateAllPlayers()
for i, pl in pairs( player.GetHumans() ) do
pl.isloaded = false
pl:KillSilent()
pl:Spawn()
Quantum.Net.Inventory.Update( pl )
end
end

@ -20,7 +20,7 @@ Quantum.Item.Create( "test2", {
name = "Trash Item Test",
desc = "This is literall trash\nLine breaker test :D\n\nTest :D",
model = "models/props_phx/gears/bevel12.mdl",
stack = 10, --wrong change later to 10 or something
stack = 10,
soulbound = false,
equipable = false,
rarity = Quantum.Rarity.Trash,
@ -28,4 +28,14 @@ Quantum.Item.Create( "test2", {
user:Kill()
user:PrintChat( "You consumed trash and died!" )
end
} )
Quantum.Item.Create( "bomb", {
name = "WW2 Bomb",
desc = "Not a real item but okay.",
model = "models/props_phx/ww2bomb.mdl",
stack = 2,
soulbound = false,
equipable = false,
rarity = Quantum.Rarity.Epic
} )
Loading…
Cancel
Save