Chessnut / NutScript

A free role-play framework for Garry's Mod.
http://nutscript.rocks
MIT License
94 stars 77 forks source link

Players Spawning Weapons in the F1 Menu #588

Closed IamBrett closed 7 years ago

IamBrett commented 9 years ago

Players can spawn weapons in the F1 menu, and I can't seem to find the file or line of code that allows me to remove that!! Please help!!!! I set the price of each weapon very high, but I would like the feature gone altogether!! Thank you.

Chessnut commented 9 years ago

The F1 menu doesn't have anything to spawn weapons

Sascha8a commented 9 years ago

I think he means, that players are able to buy weapons in the F1 menu and he can't disable the F1 menu Business Tab.

halworsen commented 9 years ago

I think you can hook into BuildBusinessMenu and return false to disable it.

IamBrett commented 9 years ago

Where would I put the hook, though?

NDKilla commented 9 years ago

@IamBrett If you changed the price of items, doesn't deleting the file remove it from the business tab? Although this might make the weapon completely unusable.

You could specify things like ITEM.faction or ITEM.flag to restrict who sees it in shop. If you want the item to exist but only select people can buy it, ITEM.flag is probably good.

I'm also assuming you only want the weapons not purchasable, not that you want the entire business menu disabled.

Chessnut commented 9 years ago

You can also add ITEM.noBusiness = true

Zenolisk commented 9 years ago

The HL2RP Schema has a Business plugin, open the sh_plugin.lua and change the CanPlayerUseBusiness() function.

if you want that nobody can use it, simply return false like this.

function PLUGIN:CanPlayerUseBusiness(client, uniqueID) return false end