Making is so Pointshop items are only allowed on some of synced servers

Hi,

I use pointshop on my servers, and have them linked via mysql.
The problem is, we have TTT, serious murder, and casual murder servers.
I want to limit items on the serious server, but when I delete them, users who have bought the item have it removed from their inventory, and them complain because something they bought is now missing.

I was told I could use this function by someone to limit the items, so they’d not be equipped on the serious servers, but would still be there, so they would not be removed from players’ accounts.


function ITEM:OnEquip(ply)
if GAMEMODE.Name == "murder" then return false
end
        ply:Give(self.WeaponClass)
end

As of now, you can still spawn into the game with a physgun, even thought this code is set to deny that. Any help would be greatly appreciated!

Thank you,
Bounty

This is probably a job for CoderHire.

To get you started, try adding


ITEM.Gamemode = "Murder"

or


ITEM.Gamemode = "Sandbox"

for each item you don’t want to show up for sale or in the inventory on other gamemodes.

Open “lua/sh_pointshop.lua” and find “function PS:LoadItems()”

Find within that function



if not ITEM.Name then
	ErrorNoHalt("[POINTSHOP] Item missing name: " .. category .. '/' .. name .. "
")
	continue
elseif not ITEM.Price then
	ErrorNoHalt("[POINTSHOP] Item missing price: " .. category .. '/' .. name .. "
")
	continue
elseif not ITEM.Model and not ITEM.Material then
	ErrorNoHalt("[POINTSHOP] Item missing model or material: " .. category .. '/' .. name .. "
")
	continue
end


Change the bottom to



elseif not ITEM.Model and not ITEM.Material then
	ErrorNoHalt("[POINTSHOP] Item missing model or material: " .. category .. '/' .. name .. "
")
	continue
elseif item.Gamemode and item.Gamemode != GAMEMODE.Name then
	--continue
	ITEM.CanPlayerBuy = false
	ITEM.CanPlayerSell = false
	ITEM.CanPlayerEquip = false
	ITEM.CanPlayerHolster = false
end



I haven’t tested this and I don’t use this pointshop but it’ll get you on the right track.