So I made custom ranks with ULX such as, Owner, Section Leader ETC... i still cant figure out a way to get the admin tab for the point shop to show up for my custom ulx ranks. Please help!
Edit the __category.lua file in the category's folder.
[QUOTE=code_gs;43060818]Edit the __category.lua file in the category's folder.[/QUOTE]
The only folders I see are, accessories, headshatsmasks, playermodels, powerups, and trails. They all have _category files, but I don't see an admin tab or admin folder any where.
Here is what I see, [url]http://puu.sh/5Bjcq/96fa7872cc.png[/url]
If you give me the names of the specific groups you want to view the tab, then I can do it for you.
[QUOTE=code_gs;43060869]If you give me the names of the specific groups you want to view the tab, then I can do it for you.[/QUOTE]
Just Owner
Is this what you're looking for?
[url]http://pointshop.burt0n.net/categories[/url]
Put this is your sv_pointshop.lua file.
[code]-- net hooks
net.Receive('PS_BuyItem', function(length, ply)
ply:PS_BuyItem(net.ReadString())
end)
net.Receive('PS_SellItem', function(length, ply)
ply:PS_SellItem(net.ReadString())
end)
net.Receive('PS_EquipItem', function(length, ply)
ply:PS_EquipItem(net.ReadString())
end)
net.Receive('PS_HolsterItem', function(length, ply)
ply:PS_HolsterItem(net.ReadString())
end)
net.Receive('PS_ModifyItem', function(length, ply)
ply:PS_ModifyItem(net.ReadString(), net.ReadTable())
end)
-- player to player
net.Receive('PS_SendPoints', function(length, ply)
local other = net.ReadEntity()
local points = math.Clamp(net.ReadInt(32), 0, 1000000)
if PS.Config.CanPlayersGivePoints and other and points and IsValid(other) and other:IsPlayer() and ply and IsValid(ply) and ply:IsPlayer() and ply:PS_HasPoints(points) then
ply:PS_TakePoints(points)
ply:PS_Notify('You gave ', other:Nick(), ' ', points, ' of your ', PS.Config.PointsName, '.')
other:PS_GivePoints(points)
other:PS_Notify(ply:Nick(), ' gave you ', points, ' of their ', PS.Config.PointsName, '.')
end
end)
-- admin points
net.Receive('PS_GivePoints', function(length, ply)
local other = net.ReadEntity()
local points = net.ReadInt(32)
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_GivePoints(points)
other:PS_Notify(ply:Nick(), ' gave you ', points, ' ', PS.Config.PointsName, '.')
end
end)
net.Receive('PS_TakePoints', function(length, ply)
local other = net.ReadEntity()
local points = net.ReadInt(32)
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_TakePoints(points)
other:PS_Notify(ply:Nick(), ' took ', points, ' ', PS.Config.PointsName, ' from you.')
end
end)
net.Receive('PS_SetPoints', function(length, ply)
local other = net.ReadEntity()
local points = net.ReadInt(32)
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_SetPoints(points)
other:PS_Notify(ply:Nick(), ' set your ', PS.Config.PointsName, ' to ', points, '.')
end
end)
-- admin items
net.Receive('PS_GiveItem', function(length, ply)
local other = net.ReadEntity()
local item_id = net.ReadString()
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and item_id and PS.Items[item_id] and IsValid(other) and other:IsPlayer() and not other:PS_HasItem(item_id) then
other:PS_GiveItem(item_id)
end
end)
net.Receive('PS_TakeItem', function(length, ply)
local other = net.ReadEntity()
local item_id = net.ReadString()
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and item_id and PS.Items[item_id] and IsValid(other) and other:IsPlayer() and other:PS_HasItem(item_id) then
-- holster it first without notificaiton
other.PS_Items[item_id].Equipped = false
local ITEM = PS.Items[item_id]
ITEM:OnHolster(other)
other:PS_TakeItem(item_id)
end
end)
-- hooks
local KeyToHook = {
F1 = "ShowHelp",
F2 = "ShowTeam",
F3 = "ShowSpare1",
F4 = "ShowSpare2",
None = "ThisHookDoesNotExist"
}
hook.Add(KeyToHook[PS.Config.ShopKey], "PS_ShopKey", function(ply)
ply:PS_ToggleMenu()
end)
hook.Add('PlayerSpawn', 'PS_PlayerSpawn', function(ply) ply:PS_PlayerSpawn() end)
hook.Add('PlayerDeath', 'PS_PlayerDeath', function(ply) ply:PS_PlayerDeath() end)
hook.Add('PlayerInitialSpawn', 'PS_PlayerInitialSpawn', function(ply) ply:PS_PlayerInitialSpawn() end)
hook.Add('PlayerDisconnected', 'PS_PlayerDisconnected', function(ply) ply:PS_PlayerDisconnected() end)
hook.Add('PlayerSay', 'PS_PlayerSay', function(ply, text)
if string.len(PS.Config.ShopChatCommand) > 0 then
if string.sub(text, 0, string.len(PS.Config.ShopChatCommand)) == PS.Config.ShopChatCommand then
ply:PS_ToggleMenu()
return ''
end
end
end)
-- ugly networked strings
util.AddNetworkString('PS_Items')
util.AddNetworkString('PS_Points')
util.AddNetworkString('PS_BuyItem')
util.AddNetworkString('PS_SellItem')
util.AddNetworkString('PS_EquipItem')
util.AddNetworkString('PS_HolsterItem')
util.AddNetworkString('PS_ModifyItem')
util.AddNetworkString('PS_SendPoints')
util.AddNetworkString('PS_GivePoints')
util.AddNetworkString('PS_TakePoints')
util.AddNetworkString('PS_SetPoints')
util.AddNetworkString('PS_GiveItem')
util.AddNetworkString('PS_TakeItem')
util.AddNetworkString('PS_AddClientsideModel')
util.AddNetworkString('PS_RemoveClientsideModel')
util.AddNetworkString('PS_SendClientsideModels')
util.AddNetworkString('PS_SendNotification')
util.AddNetworkString('PS_ToggleMenu')
-- console commands
concommand.Add(PS.Config.ShopCommand, function(ply, cmd, args)
ply:PS_ToggleMenu()
end)
concommand.Add('ps_clear_points', function(ply, cmd, args)
if IsValid(ply) then return end -- only allowed from server console
for _, ply in pairs(player.GetAll()) do
ply:PS_SetPoints(0)
end
sql.Query("DELETE FROM playerpdata WHERE infoid LIKE '%PS_Points%'")
end)
concommand.Add('ps_clear_items', function(ply, cmd, args)
if IsValid(ply) then return end -- only allowed from server console
for _, ply in pairs(player.GetAll()) do
ply.PS_Items = {}
ply:PS_SendItems()
end
sql.Query("DELETE FROM playerpdata WHERE infoid LIKE '%PS_Items%'")
end)
-- version checker
PS.CurrentBuild = 0
PS.LatestBuild = 0
PS.BuildOutdated = false
local function CompareVersions()
if PS.CurrentBuild < PS.LatestBuild then
MsgN('PointShop is out of date!')
MsgN('Local version: ' .. PS.CurrentBuild .. ', Latest version: ' .. PS.LatestBuild)
PS.BuildOutdated = true
else
MsgN('PointShop is on the latest version.')
end
end
function PS:CheckVersion()
if file.Exists('data/pointshop_build.txt', 'GAME') then
PS.CurrentBuild = tonumber(file.Read('data/pointshop_build.txt', 'GAME')) or 0
end
local url = self.Config.Branch ..
[QUOTE=code_gs;43060950]Put this is your sv_pointshop.lua file.
[code]-- net hooks
net.Receive('PS_BuyItem', function(length, ply)
ply:PS_BuyItem(net.ReadString())
end)
net.Receive('PS_SellItem', function(length, ply)
ply:PS_SellItem(net.ReadString())
end)
net.Receive('PS_EquipItem', function(length, ply)
ply:PS_EquipItem(net.ReadString())
end)
net.Receive('PS_HolsterItem', function(length, ply)
ply:PS_HolsterItem(net.ReadString())
end)
net.Receive('PS_ModifyItem', function(length, ply)
ply:PS_ModifyItem(net.ReadString(), net.ReadTable())
end)
-- player to player
net.Receive('PS_SendPoints', function(length, ply)
local other = net.ReadEntity()
local points = math.Clamp(net.ReadInt(32), 0, 1000000)
if PS.Config.CanPlayersGivePoints and other and points and IsValid(other) and other:IsPlayer() and ply and IsValid(ply) and ply:IsPlayer() and ply:PS_HasPoints(points) then
ply:PS_TakePoints(points)
ply:PS_Notify('You gave ', other:Nick(), ' ', points, ' of your ', PS.Config.PointsName, '.')
other:PS_GivePoints(points)
other:PS_Notify(ply:Nick(), ' gave you ', points, ' of their ', PS.Config.PointsName, '.')
end
end)
-- admin points
net.Receive('PS_GivePoints', function(length, ply)
local other = net.ReadEntity()
local points = net.ReadInt(32)
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_GivePoints(points)
other:PS_Notify(ply:Nick(), ' gave you ', points, ' ', PS.Config.PointsName, '.')
end
end)
net.Receive('PS_TakePoints', function(length, ply)
local other = net.ReadEntity()
local points = net.ReadInt(32)
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_TakePoints(points)
other:PS_Notify(ply:Nick(), ' took ', points, ' ', PS.Config.PointsName, ' from you.')
end
end)
net.Receive('PS_SetPoints', function(length, ply)
local other = net.ReadEntity()
local points = net.ReadInt(32)
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and points and IsValid(other) and other:IsPlayer() then
other:PS_SetPoints(points)
other:PS_Notify(ply:Nick(), ' set your ', PS.Config.PointsName, ' to ', points, '.')
end
end)
-- admin items
net.Receive('PS_GiveItem', function(length, ply)
local other = net.ReadEntity()
local item_id = net.ReadString()
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and item_id and PS.Items[item_id] and IsValid(other) and other:IsPlayer() and not other:PS_HasItem(item_id) then
other:PS_GiveItem(item_id)
end
end)
net.Receive('PS_TakeItem', function(length, ply)
local other = net.ReadEntity()
local item_id = net.ReadString()
if not PS.Config.AdminCanAccessAdminTab and not PS.Config.SuperAdminCanAccessAdminTab and not PS.Config.OwnerCanAccessAdminTab then return end
local admin_allowed = PS.Config.AdminCanAccessAdminTab and ply:IsAdmin()
local super_admin_allowed = PS.Config.SuperAdminCanAccessAdminTab and ply:IsSuperAdmin()
local owner_allowed = PS.Config.OwnerCanAccessAdminTab and ply:IsUserGroup("Owner")
if (admin_allowed or super_admin_allowed or owner_allowed) and other and item_id and PS.Items[item_id] and IsValid(other) and other:IsPlayer() and other:PS_HasItem(item_id) then
-- holster it first without notificaiton
other.PS_Items[item_id].Equipped = false
local ITEM = PS.Items[item_id]
ITEM:OnHolster(other)
other:PS_TakeItem(item_id)
end
end)
-- hooks
local KeyToHook = {
F1 = "ShowHelp",
F2 = "ShowTeam",
F3 = "ShowSpare1",
F4 = "ShowSpare2",
None = "ThisHookDoesNotExist"
}
hook.Add(KeyToHook[PS.Config.ShopKey], "PS_ShopKey", function(ply)
ply:PS_ToggleMenu()
end)
hook.Add('PlayerSpawn', 'PS_PlayerSpawn', function(ply) ply:PS_PlayerSpawn() end)
hook.Add('PlayerDeath', 'PS_PlayerDeath', function(ply) ply:PS_PlayerDeath() end)
hook.Add('PlayerInitialSpawn', 'PS_PlayerInitialSpawn', function(ply) ply:PS_PlayerInitialSpawn() end)
hook.Add('PlayerDisconnected', 'PS_PlayerDisconnected', function(ply) ply:PS_PlayerDisconnected() end)
hook.Add('PlayerSay', 'PS_PlayerSay', function(ply, text)
if string.len(PS.Config.ShopChatCommand) > 0 then
if string.sub(text, 0, string.len(PS.Config.ShopChatCommand)) == PS.Config.ShopChatCommand then
ply:PS_ToggleMenu()
return ''
end
end
end)
-- ugly networked strings
util.AddNetworkString('PS_Items')
util.AddNetworkString('PS_Points')
util.AddNetworkString('PS_BuyItem')
util.AddNetworkString('PS_SellItem')
util.AddNetworkString('PS_EquipItem')
util.AddNetworkString('PS_HolsterItem')
util.AddNetworkString('PS_ModifyItem')
util.AddNetworkString('PS_SendPoints')
util.AddNetworkString('PS_GivePoints')
util.AddNetworkString('PS_TakePoints')
util.AddNetworkString('PS_SetPoints')
util.AddNetworkString('PS_GiveItem')
util.AddNetworkString('PS_TakeItem')
util.AddNetworkString('PS_AddClientsideModel')
util.AddNetworkString('PS_RemoveClientsideModel')
util.AddNetworkString('PS_SendClientsideModels')
util.AddNetworkString('PS_SendNotification')
util.AddNetworkString('PS_ToggleMenu')
-- console commands
concommand.Add(PS.Config.ShopCommand, function(ply, cmd, args)
ply:PS_ToggleMenu()
end)
concommand.Add('ps_clear_points', function(ply, cmd, args)
if IsValid(ply) then return end -- only allowed from server console
for _, ply in pairs(player.GetAll()) do
ply:PS_SetPoints(0)
end
sql.Query("DELETE FROM playerpdata WHERE infoid LIKE '%PS_Points%'")
end)
concommand.Add('ps_clear_items', function(ply, cmd, args)
if IsValid(ply) then return end -- only allowed from server console
for _, ply in pairs(player.GetAll()) do
ply.PS_Items = {}
ply:PS_SendItems()
end
sql.Query("DELETE FROM playerpdata WHERE infoid LIKE '%PS_Items%'")
end)
-- version checker
PS.CurrentBuild = 0
PS.LatestBuild = 0
PS.BuildOutdated = false
local function CompareVersions()
if PS.CurrentBuild < PS.LatestBuild then
MsgN('PointShop is out of date!')
MsgN('Local version: ' .. PS.CurrentBuild .. ', Latest version: ' .. PS.LatestBuild)
PS.BuildOutdated = true
else
MsgN('PointShop is on the latest version.')
end
end
function PS:CheckVersion()
if file.Exists('data/pointshop_build.txt', 'GAME') then
PS.CurrentBuild = tonumber(file.Read('data/pointshop_build.txt', 'GAME')) or 0
end
local url
Sorry, I have a custom DPointShopMenu. Search for a line that says
[code]if (PS.Config.AdminCanAccessAdminTab and LocalPlayer():IsAdmin()) or (PS.Config.SuperAdminCanAccessAdminTab and LocalPlayer():IsSuperAdmin()) then[/code]
[QUOTE=code_gs;43061276]Sorry, I have a custom DPointShopMenu. Search for a line that says
[code]if (PS.Config.AdminCanAccessAdminTab and LocalPlayer():IsAdmin()) or (PS.Config.SuperAdminCanAccessAdminTab and LocalPlayer():IsSuperAdmin()) then[/code][/QUOTE]
Alright, I replaced it, but getting lua error. shop wont open
What's the error?
[ERROR] addons/pointshop-master/lua/cl_pointshop.lua:14: attempt to index field 'ShopMenu' (a nil value)
1. ToggleMenu - addons/pointshop-master/lua/cl_pointshop.lua:14
2. func - addons/pointshop-master/lua/cl_pointshop.lua:65
3. unknown - lua/includes/modules/net.lua:31
[QUOTE=code_gs;43061322]What's the error?[/QUOTE] I did not even tamper with that file, and point shop wont even open.
Mine works just fine. Just manually drag in these files and it should fix your issue: [url]https://www.dropbox.com/s/4sigrs6a6elafrq/pointshopfiles.rar[/url]
[QUOTE=code_gs;43061538]Mine works just fine. Just manually drag in these files and it should fix your issue: [url]https://www.dropbox.com/s/4sigrs6a6elafrq/pointshopfiles.rar[/url][/QUOTE]
I deleted all the old files, and replaced them with the dropbox ones. Still not working =/ And just to make sure, is the dpointshopmenu line correct? [url]http://puu.sh/5BmQI/a32387fd46.png[/url]
I just noticed your edit, and you did the DPointShopMenu wrong. Put this in DPointShopMenu.lua:
[code]surface.CreateFont('PS_Heading', { font = 'coolvetica', size = 64 })
surface.CreateFont('PS_Heading2', { font = 'coolvetica', size = 24 })
surface.CreateFont('PS_Heading3', { font = 'coolvetica', size = 19 })
local ALL_ITEMS = 1
local OWNED_ITEMS = 2
local UNOWNED_ITEMS = 3
local function BuildItemMenu(menu, ply, itemstype, callback)
local plyitems = ply:PS_GetItems()
for category_id, CATEGORY in pairs(PS.Categories) do
local catmenu = menu:AddSubMenu(CATEGORY.Name)
table.SortByMember(PS.Items, PS.Config.SortItemsBy, function(a, b) return a > b end)
for item_id, ITEM in pairs(PS.Items) do
if ITEM.Category == CATEGORY.Name then
if itemstype == ALL_ITEMS or (itemstype == OWNED_ITEMS and plyitems[item_id]) or (itemstype == UNOWNED_ITEMS and not plyitems[item_id]) then
catmenu:AddOption(ITEM.Name, function() callback(item_id) end)
end
end
end
end
end
local PANEL = {}
function PANEL:Init()
self:SetSize( math.Clamp( 1024, 0, ScrW() ), math.Clamp( 768, 0, ScrH() ) )
self:SetPos((ScrW() / 2) - (self:GetWide() / 2), (ScrH() / 2) - (self:GetTall() / 2))
-- close button
local closeButton = vgui.Create('DButton', self)
closeButton:SetFont('marlett')
closeButton:SetText('r')
closeButton:SetColor(Color(255, 255, 255))
closeButton:SetSize(15, 15)
closeButton:SetDrawBackground(false)
closeButton:SetPos(self:GetWide() - 25, 10)
closeButton.DoClick = function()
PS:ToggleMenu()
end
local tabs = vgui.Create('DPropertySheet', self)
if PS.Config.DisplayPreviewInMenu then
tabs:DockMargin(10, 80, 410, 10)
else
tabs:DockMargin(10, 80, 10, 10)
end
tabs:Dock(FILL)
tabs:SetSize(self:GetWide() - 60, self:GetTall() - 150)
tabs:SetPos((self:GetWide() / 2) - (tabs:GetWide() / 2), 120)
-- sorting
local categories = {}
for _, i in pairs(PS.Categories) do
table.insert(categories, i)
end
table.sort(categories, function(a, b)
if a.Order == b.Order then
return a.Name < b.Name
else
return a.Order < b.Order
end
end)
local items = {}
for _, i in pairs(PS.Items) do
table.insert(items, i)
end
table.SortByMember(items, PS.Config.SortItemsBy, function(a, b) return a > b end)
-- items
for _, CATEGORY in pairs(categories) do
if CATEGORY.AllowedUserGroups and #CATEGORY.AllowedUserGroups > 0 then
if not table.HasValue(CATEGORY.AllowedUserGroups, LocalPlayer():PS_GetUsergroup()) then
continue
end
end
if CATEGORY.CanPlayerSee then
if not CATEGORY:CanPlayerSee(LocalPlayer()) then
continue
end
end
local ShopCategoryTab = vgui.Create('DPanel')
local DScrollPanel = vgui.Create('DScrollPanel', ShopCategoryTab)
DScrollPanel:Dock(FILL)
local ShopCategoryTabLayout = vgui.Create('DIconLayout', DScrollPanel)
ShopCategoryTabLayout:Dock(FILL)
ShopCategoryTabLayout:SetBorder(10)
ShopCategoryTabLayout:SetSpaceX(10)
ShopCategoryTabLayout:SetSpaceY(10)
DScrollPanel:AddItem(ShopCategoryTabLayout)
for _, ITEM in pairs(items) do
if ITEM.Category == CATEGORY.Name then
local model = vgui.Create('DPointShopItem')
model:SetData(ITEM)
model:SetSize(126, 126)
ShopCategoryTabLayout:Add(model)
end
end
tabs:AddSheet(CATEGORY.Name, ShopCategoryTab, 'icon16/' .. CATEGORY.Icon .. '.png', false, false, '')
end
if (PS.Config.AdminCanAccessAdminTab and LocalPlayer():IsAdmin()) or (PS.Config.SuperAdminCanAccessAdminTab and LocalPlayer():IsSuperAdmin()) or (PS.Config.OwnerCanAccessAdminTab and LocalPlayer():IsUserGroup("Owner")) then
-- admin tab
local AdminTab = vgui.Create('DPanel')
local ClientsList = vgui.Create('DListView', AdminTab)
ClientsList:DockMargin(10, 10, 10, 10)
ClientsList:Dock(FILL)
ClientsList:SetMultiSelect(false)
ClientsList:AddColumn('Name')
ClientsList:AddColumn('Points'):SetFixedWidth(60)
ClientsList:AddColumn('Items'):SetFixedWidth(60)
ClientsList.OnClickLine = function(parent, line, selected)
local ply = line.Player
local menu = DermaMenu()
menu:AddOption('Set '..PS.Config.PointsName..'...', function()
Derma_StringRequest(
"Set "..PS.Config.PointsName.." for " .. ply:GetName(),
"Set "..PS.Config.PointsName.." to...",
"",
function(str)
if not str or not tonumber(str) then return end
net.Start('PS_SetPoints')
net.WriteEntity(ply)
net.WriteInt(tonumber(str), 32)
net.SendToServer()
end
)
end)
menu:AddOption('Give '..PS.Config.PointsName..'...', function()
Derma_StringRequest(
"Give "..PS.Config.PointsName.." to " .. ply:GetName(),
"Give "..PS.Config.PointsName.."...",
"",
function(str)
if not str or not tonumber(str) then return end
net.Start('PS_GivePoints')
net.WriteEntity(ply)
net.WriteInt(tonumber(str), 32)
net.SendToServer()
end
)
end)
menu:AddOption('Take '..PS.Config.PointsName..'...', function()
Derma_StringRequest(
"Take "..PS.Config.PointsName.." from " .. ply:GetName(),
It worked, thanks so much!!!! <3
Sorry, you need to Log In to post a reply to this thread.