Git Product home page Git Product logo

weapon-restrict's Introduction

Weapon Restrict

The plugin allows you to restrict the use of certain weapons depending on the players in the teams or the total number of players, as well as the number of specified weapons. You can also set administrators' immunity to restrictions

Requirements

Install

  • Drop folder build/Weapon_Restrict to addons/counterstrikesharp/plugins/

  • Configuration files will be generated after the plugin is launched in the folder addons/counterstrikesharp/plugins/Weapon_Restrict:

    • Config.json - Common settings
    • RestrictConfig.json - Restrictions settings

Configs

Config.json

{
	"Tag": "{GOLD}[WeaponRestrict] ",		// Tag before text of plugin
	"DestinationTypeRestrictMessage": 1,	// Specifies how the prohibition message will be displayed	[ 1 - chat | 2 - center]
	"DestinationTypeRefundMessage": 1,	// Specifies how the refund message will be displayed
	"RestrictMessageText": "{TAG}{DEFAULT}Weapon {OLIVE}{WEAPON}{DEFAULT} is {DARKRED}restricted{DEFAULT} to {GREEN}{COUNT}{DEFAULT} at the moment", // Restrict message
	"RestrictMessageStatus": true,					// Indicates whether the restrict message is enabled		[ true - on | false - off]
	"RefundMessage": "{TAG}Money redunded {GOLD}{MONEY}",	// Refund message
	"RefundMessageStatus": true,						// Indicates whether the refund message is enabled			[ true - on | false - off]
	"RestrictMethod": 2,								// Method of restricting [ 1 - by players of team | 2 - by weapons count | 3 - by total players ]
	"AdminImmunityFlag": "@css/root"				// Admin-flag to enable immunity for player. Admin list can be finded here:`addons/counterstrikesharp/configs/admins.json`
}

RestrictConfig.json

{
	"Weapon": "weapon_deagle",	// weapon class for restriction
	"WeaponQuota": {			// using this method if RestrictMethod = 2. Calculated by total weapon count in team
		"CT": 1,					// Allowed deagles to CT-team to 1
		"T": 4						// Allowed deagles to T-team to 4
	},
	"PlayersInTeamQuota": {			// using this method if RestrictMethod = 1. Calculated by players for each team 
		"CT": [					// team
			{
				"4": 0,				// Allowed deagles to CT-team to 0 for 4-7 players
				"8": 4,				// Allowed deagles to CT-team to 4 for 8-15 players
				"16": 7				// Allowed deagles to CT-team to 7 for 16-... players
				// here can add more player conditions using ","
			}
		],
		"T": [					// team
			{
				"4": 3,               // Allowed deagles to T-team to 3 for 4-7 players
				"8": 4,               // Allowed deagles to T-team to 4 for 8-15 players
				"16": 9               // Allowed deagles to T-team to 9 for 16-... players
				// here can add more player conditions using ","
			}
		]
	},
	"PlayersAllQuota": {			// using this method if RestrictMethod = 3. Calculated by Total players in both teams 
		"4": 1,						// Allowed deagles to 1 for 4-7 players
		"8": 2,						// Allowed deagles to 2 for 8-15 players
		"16": 3						// Allowed deagles to 3 for 16-... players
	}
}
// here can add more weapons using ","
- Do not try to copy this jsons into your config. Json does not support commenting! Comments have been added here for your convenience.

About possible problems, please let me know:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.