I try to remove and redownload but it still happens
[code]
[ERROR] addons/pointshop-master/lua/pointshop/sh_init.lua:153: table index is nil
1. LoadItems - addons/pointshop-master/lua/pointshop/sh_init.lua:153
2. Initialize - addons/pointshop-master/lua/pointshop/sh_init.lua:55
3. unknown - addons/pointshop-master/lua/autorun/pointshop.lua:4[/code]
Lines:
[code]
sh_init.lua 153: self.Items[ITEM.ID] = ITEM
sh_init.lua 55: self:LoadItems()
pointshop.lua 4: PS:Initialize()[/code]
Full code (sh_init.lua)
[lua]
--[[
pointshop/sh_init.lua
first file included on both states.
]]--
PS = {}
PS.__index = PS
PS.Items = {}
PS.Categories = {}
PS.ClientsideModels = {}
include("sh_config.lua")
include("sh_player_extension.lua")
-- validation
function PS:ValidateItems(items)
if type(items) ~= 'table' then return {} end
-- Remove any items that no longer exist
for item_id, item in pairs(items) do
if not self.Items[item_id] then
items[item_id] = nil
end
end
return items
end
function PS:ValidatePoints(points)
if type(points) != 'number' then return 0 end
return points >= 0 and points or 0
end
-- Utils
function PS:FindCategoryByName(cat_name)
for id, cat in pairs(self.Categories) do
if cat.Name == cat_name then
return cat
end
end
return false
end
-- Initialization
function PS:Initialize()
if SERVER then self:LoadDataProvider() end
if SERVER and self.Config.CheckVersion then self:CheckVersion() end
self:LoadItems()
end
-- Loading
function PS:LoadItems()
local _, dirs = file.Find('pointshop/items/*', 'LUA')
for _, category in pairs(dirs) do
local f, _ = file.Find('pointshop/items/' .. category .. '/__category.lua', 'LUA')
if #f > 0 then
CATEGORY = {}
CATEGORY.Name = ''
CATEGORY.Icon = ''
CATEGORY.Order = 0
CATEGORY.AllowedEquipped = -1
CATEGORY.AllowedUserGroups = {}
CATEGORY.CanPlayerSee = function() return true end
CATEGORY.ModifyTab = function(tab) return end
if SERVER then AddCSLuaFile('pointshop/items/' .. category .. '/__category.lua') end
include('pointshop/items/' .. category .. '/__category.lua')
if not PS.Categories[category] then
PS.Categories[category] = CATEGORY
end
local files, _ = file.Find('pointshop/items/' .. category .. '/*.lua', 'LUA')
for _, name in pairs(files) do
if name ~= '__category.lua' then
if SERVER then AddCSLuaFile('pointshop/items/' .. category .. '/' .. name) end
ITEM = {}
ITEM.__index = ITEM
ITEM.ID = string.gsub(string.lower(name), '.lua', '')
ITEM.Category = CATEGORY.Name
ITEM.Price = 0
-- model and material are missing but there's no way around it, there's a check below anyway
ITEM.AdminOnly = false
ITEM.AllowedUserGroups = {} -- this will fail the #ITEM.AllowedUserGroups test and continue
ITEM.SingleUse = false
ITEM.NoPreview = false
ITEM.CanPlayerBuy = true
ITEM.CanPlayerSell = true
ITEM.CanPlayerEquip = true
ITEM.CanPlayerHolster = true
ITEM.OnBuy = function() end
ITEM.OnSell = function() end
ITEM.OnEquip = function() end
ITEM.OnHolster = function() end
ITEM.OnModify = function() end
ITEM.ModifyClientsideModel = function(ITEM, ply, model, pos, ang)
return model, pos, ang
end
include('pointshop/items/' .. category .. '/' .. name)
if not ITEM.Name then
ErrorNoHalt("[POINTSHOP] Item missing name: " .. category .. '/' .. name .. "\n")
continue
elseif not ITEM.Price then
ErrorNoHalt("[POINTSHOP] Item missing price: " .. category .. '/' .. name .. "\n")
continue
elseif not ITEM.Model and not ITEM.Material then
ErrorNoHalt("[POINTSHOP] Item missing model or material: " .. category .. '/' .. name .. "\n")
continue
end
-- precache
if ITEM.Model then
util.PrecacheModel(ITEM.Model)
end
-- item hooks
local item = ITEM
for prop, val in pairs(item) do
if type(val) == "function" then -- although this hooks every function, it doesn't matter because the non-hook functions will never get called
hook.Add(prop, 'PS_Item_' .. item.Name .. '_' .. prop, function(...)
for _, ply in pairs(player.GetAll()) do
if ply:PS_HasItemEquipped(item.ID) then -- hooks are only called if the player has the item equipped
item[prop](item, ply, ply.PS_Items[item.ID].Modifiers, unpack({...}))
end
end
end)
end
end
self.Items[ITEM.ID] = ITEM
ITEM = nil
end
end
CATEGORY = nil
end
end
end[/lua]
Code (pointshop.lua)
[lua]
if SERVER then AddCSLuaFile() include "pointshop/sv_init.lua" end
if CLIENT then include "pointshop/cl_init.lua" end
PS:Initialize()[/lua]
I am the worst coder btw
PLEASE I NEED THIS SO BAD :C
Ok wtf pointshop :c
[IMG]http://i.imgur.com/uGpdKCB.jpg[/IMG]
Admin menu still works...
[IMG]http://i.imgur.com/NVhccrP.jpg[/IMG]
So yeah :c please help soon this is really bad for my server and stuff.
have you tried using it without the custom skin?
Oh shit dog it's a mega error, get Garry ASAP!
[QUOTE=Arizard;45984409]have you tried using it without the custom skin?[/QUOTE]
That's the new default skin.
[editline]15th September 2014[/editline]
[QUOTE=AnonTakesOver;45984432]Oh shit dog it's a mega error, get Garry ASAP![/QUOTE]
If you have nothing to say, don't say it.
[editline]15th September 2014[/editline]
[QUOTE=Imbadatoot;45983969]I try to remove and redownload but it still happens
[/QUOTE]
How are you installing this?
[QUOTE=mib999;45984495]How are you installing this?[/QUOTE]
I just drag and drop the folder. I have tried to see if removing a few plugins would fix it but it just wont work.
Edit: On any server I go to I have small text.
Edit2: I do delete the folder btw.
[QUOTE=Imbadatoot;45988068]I just drag and drop the folder. I have tried to see if removing a few plugins would fix it but it just wont work.
Edit: On any server I go to I have small text.
Edit2: I do delete the folder btw.[/QUOTE]
Where do you drag & drop the folder?
Are you using a BLANK version of PointShop?
[QUOTE=mib999;45988576]Where do you drag & drop the folder?
Are you using a BLANK version of PointShop?[/QUOTE]
like a blank addon.txt?
(obviously drag to addons :p)
edit: somehow by doing a clean install (downloaded again from github) it fixed itself.
Now, Please tell me why the hell i have small text in the pointshop.
[QUOTE=Imbadatoot;45988839]like a blank addon.txt?
(obviously drag to addons :p)[/QUOTE]
A blank addon, as in, you havent edited it.
Christ.
[QUOTE=mib999;45988871]A blank addon, as in, you havent edited it.
Christ.[/QUOTE]
I did edit only the items area to add some items to the pointshop. but idk why that would cause everything to die.
Sorry, you need to Log In to post a reply to this thread.