addhook("buy","nobuyingFunc")
function nobuyingFunc(id)
	if SERVER_DATA["nobuying"] then
		ErrorMSG(id, "Buying has been disabled")
		return 1
	end
end

function NobuyingButton()
	if SERVER_DATA["nobuying"] then
		return "No buying|Enabled"
	end
	return "No buying|Disabled"
end

function NobuyingToggle()
	if SERVER_DATA["nobuying"] then
		SERVER_DATA["nobuying"] = nil
		msg("no buying DISABLED@C")
	else
		SERVER_DATA["nobuying"] = true
		msg("no buying ENABLED@C")
	end
end

CreateSetting(NobuyingButton, NobuyingToggle)