Added constant variable file & item equip server side progress

master
AlmTech Software 5 years ago
parent 83eeea9bde
commit a090bc138b
  1. 3
      gamemode/cl_init.lua
  2. 4
      gamemode/engine/lib/server/sv_inventory.lua
  3. 1
      gamemode/engine/lib/sh_effects.lua
  4. 56
      gamemode/engine/lib/sh_vars.lua
  5. 14
      gamemode/settings/sh_settings.lua
  6. 18
      gamemode/shared.lua

@ -8,9 +8,6 @@
if CLIENT then
include( "shared.lua" )
Quantum.Client = Quantum.Client || {}
Quantum.Client.Cache = Quantum.Client.Cache || {}
Quantum.Client.ResolutionScale = ScrH() / 1080
Quantum.Client.ServerBannerPath = "gamemodes/" .. GM.FolderName .. "/gamemode/content/materials/quantum/server_banner.png"
local function loadCoreFiles()
local fol = GM.FolderName .. "/gamemode/engine/core/"

@ -31,11 +31,12 @@ local function isStackable( item )
return item.stack || false
end
function Quantum.Server.Inventory.SetEquipSlotItem( pl, itemindex )
function Quantum.Server.Inventory.EquipItem( pl, itemindex )
local char = Quantum.Server.Char.GetCurrentCharacter( pl )
local slotitem = Quantum.Server.Inventory.GetSlotItem( char, index )
local itemTbl = Quantum.Item.Get( slotitem[1] )
if( itemTbl != nil ) then
local equipslot = itemTbl.equipslot
if( equipslot == nil ) then
@ -45,6 +46,7 @@ function Quantum.Server.Inventory.SetEquipSlotItem( pl, itemindex )
end
end
end
function Quantum.Server.Inventory.SetSlotItem( pl, char, pos, itemid, amount )
local setItemTbl = {}

@ -94,4 +94,5 @@ if SERVER then -- server only functions
end
end
end
end

@ -0,0 +1,56 @@
-- __ _ _______ _ __
-- / / /\ | | |__ __| | | \ \
-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \
-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > >
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
if SERVER then -- SERVER VARS UNDER THIS LINE
end --
if CLIENT then -- SERVER VARS UNDER THIS LINE
Quantum.Client.Cache = Quantum.Client.Cache || {}
Quantum.Client.ResolutionScale = ScrH() / 1080
Quantum.Client.ServerBannerPath = "gamemodes/" .. GM.FolderName .. "/gamemode/content/materials/quantum/server_banner.png"
end --
-- SHARED VARS UNDER THIS LINE
Quantum.ItemInfoDisplayMaxDistance = 200
Quantum.CharInfoDisplayDistance = 400
Quantum.Rarity = {
None = { txt = "gnomerd the mvp", color = Color( 0, 0, 0, 120 ) },
Trash = { txt = "Trash", color = Color( 100, 100, 100, 40 ) },
Common = { txt = "Common", color = Color( 250, 250, 250, 40 ) },
Rare = { txt = "Rare", color = Color( 48, 163, 230, 40 ) },
Epic = { txt = "Epic", color = Color( 220, 90, 90, 40 ) },
Legendary = { txt = "Legendary", color = Color( 235, 125, 52, 40 ) }
}
---- Placeholders ----
Quantum.EmptyFunction = function() end
---- NETWORKING VARS DO NOT TOUCH ----
Quantum.IntCode = {
SET_ITEM = 0,
DROP_ITEM = 1,
USE_ITEM = 2,
EAT_ITEM = 3,
EQUIP_ITEM = 4,
DESTROY_ITEM = 5,
UPDATE = 6,
BIT_SIZE = 3
}
function Quantum.calculateNeededBits( n ) return math.ceil( math.log( n, 2 ) ) end
function Quantum.WriteIntcode( intcode ) net.WriteInt( intcode, Quantum.IntCode.BIT_SIZE ) end

@ -6,7 +6,7 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
Quantum.CharacterLimit = 5
Quantum.CharacterNameLimit = 12
Quantum.CharacterNameLimit = 18
Quantum.CharacterNameMin = 3
Quantum.ServerTitle = "Electron Networks: CityRP"
Quantum.DiscordInvite = "https://discord.gg/heUJB4B"
@ -28,24 +28,12 @@ Quantum.EquipSlots = {
Quantum.InventoryOpenDelay = 0.35
Quantum.ItemPickupTime = 0.5 -- seconds
Quantum.ItemInfoDisplayMaxDistance = 200
Quantum.CharInfoDisplayDistance = 400
Quantum.Money = {
Prefix = "$",
Surfix = ""
}
Quantum.Rarity = {
None = { txt = "gnomerd the mvp", color = Color( 0, 0, 0, 120 ) },
Trash = { txt = "Trash", color = Color( 100, 100, 100, 40 ) },
Common = { txt = "Common", color = Color( 250, 250, 250, 40 ) },
Rare = { txt = "Rare", color = Color( 48, 163, 230, 40 ) },
Epic = { txt = "Epic", color = Color( 220, 90, 90, 40 ) },
Legendary = { txt = "Legendary", color = Color( 235, 125, 52, 40 ) }
}
Quantum.Bind = {
OpenInventory = KEY_TAB
}

@ -13,24 +13,6 @@ GM.Website = "N/A"
Quantum = {}
Quantum.Version = "v0.3-alpha"
Quantum.EmptyFunction = function() end
include( "engine/sh_debug.lua" ) -- add the debug functions and stuff
include( "settings/sh_settings.lua" )
Quantum.IntCode = {
SET_ITEM = 0,
DROP_ITEM = 1,
USE_ITEM = 2,
EAT_ITEM = 3,
EQUIP_ITEM = 4,
DESTROY_ITEM = 5,
UPDATE = 6,
BIT_SIZE = 3
}
function Quantum.calculateNeededBits( n ) return math.ceil( math.log( n, 2 ) ) end
function Quantum.WriteIntcode( intcode ) net.WriteInt( intcode, Quantum.IntCode.BIT_SIZE ) end
Loading…
Cancel
Save