Giter VIP home page Giter VIP logo

kps-allocator's Introduction

KPS Allocator

What is it?

A Simple Weapon Allocator For https://github.com/b3none/cs2-retakes.

I made this for our own community server as at that time there was no weapn allocation mod that fit our needs.

Installation

  1. Make sure CSSharp is installed (https://github.com/roflmuffin/CounterStrikeSharp/releases)
  2. Make sure CS2Retakes is installed (https://github.com/b3none/cs2-retakes/releases)
  3. Download the latest KPS Allocator release from https://github.com/nokkvireyr/kps-allocator/releases
  4. extract the zip file to your CSSharp plugins folder
  5. Start your server and enjoy!

Usage

Commands

This plugins consist of only (2) commands

  • !guns/!gun brings up a gun selection menu for the team you are currently on.
  • !guns/!gun <CT/T> brings up a gun selection menu for the team that is selected in the command.

Configuration

The configuration file is located in /addons/counterstrikesharp/plugins/KPSAllocator

Database Configuration

database.json

The plugins supports both MySQL and SQLite. You can choose which one you want to use by changing the engine value in the database.json file. Default is SQLite.

{
  "engine": "sql",        //-> Change this to "mysql" if you want to use MySQL
  "Host": "localhost",    //-> Only need to change this if you are using MySQL
  "Port": 3306,           //-> Only need to change this if you are using MySQL
  "User": "username",     //-> Only need to change this if you are using MySQL
  "Pass": "password",     //-> Only need to change this if you are using MySQL
  "Database": "database", //-> Only need to change this if you are using MySQL
  "Version": "1.0.0"      //-> Don't change this
}

Game Configuration

game.json

This file is used to configure the weapon allocator settings. Ex Util settings, Round Types, Random Rounds and so on.

{
  //If true, the rounds will be roundomly played, not linearly.
  "RandomRound": false, 
  "RoundPercentage": {
    //If true, the round will be played as a fixed rounds so ex FullBuy: 20, SmallBuy: 5, Pistol: 5 will play 20 FullBuy rounds, 5 SmallBuy rounds and 5 Pistol rounds. And if there are still more rounds left it will fallback to play the remaining rounds as FullBuy rounds.
    "IsFixed": false,
    // These are the round percentages. So default is 83% FullBuy, 7% SmallBuy and 10% Pistol (Make sure it adds up to 100%). If Fixed round are used then this needs to be changed to round numbers and not percentages.
    "FullBuy": 83,
    "SmallBuy": 7,
    "Pistol": 10
  },
  // RoundUtilValue is used to determmin what Util value each round has
  "RoundUtilValue": [
    // Default for pistol round is 0 - 100, Which does not provide any util. This can be changed to 101 - 102 to provide a flashbang.
    {
      "Min": 0,
      "Max": 100,
      "RoundType": "Pistol"
    },
    // Default for Small Buy Rounds is 300 - 500 which mean the plugin gives a player a random "value" and distributes utils based on that value.
    {
      "Min": 300,
      "Max": 500,
      "RoundType": "SmallBuy"
    },
    // Default for Small Buy Rounds is 500 - 800 which mean the plugin gives a player a random "value" and distributes utils based on that value.
    {
      "Min": 500,
      "Max": 800,
      "RoundType": "FullBuy"
    }
  ],
  // This is to set the value of the utils. So if you want to change the value of a flashbang to 200 you would change the value to 200. You can also change the amount of util that the use can be given for each type (Only viable for flashbangs, other wise it will drop the util on the ground). The plugin will then randomly distribute the utils based on the value the player was given (configured above).
  "UtilValues": [
    {
      "Item": "Flashbang",
      "Value": 200,
      "Amount": 1
    },
    {
      "Item": "Smoke",
      "Value": 300,
      "Amount": 1
    },
    {
      "Item": "Molotov",
      "Value": 500,
      "Amount": 1
    },
    {
      "Item": "HighExplosive",
      "Value": 200,
      "Amount": 1
    }
  ],
  "Version": "1.0.0"
}

TODO

  • Add support for configuring Guns selection
  • Better Guns Menu (Possibly by using CS2 Vote System)

kps-allocator's People

Contributors

b3none avatar nokkvireyr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

zyzz1989

kps-allocator's Issues

MYSQL Error connetion database,

hi, i got this error when i try to enable mysql with your plugins.

[KPS Allocator] Databaser error. Something went wrong. MySqlServerVersion is not compatible with the supplied server type.
17:49:56 [EROR] (cssharp:PluginManager) Failed to load plugin from /home/container/game/csgo/addons/counterstrikesharp/plugins/KPSAllocator/KPSAllocator.dll
System.InvalidOperationException: No database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions object in its constructor and passes it to the base constructor for DbContext.
at Microsoft.EntityFrameworkCore.Internal.DbContextServices.Initialize(IServiceProvider scopedProvider, DbContextOptions contextOptions, DbContext context)
at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetRelationalService[TService](IInfrastructure`1 databaseFacade)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at KPSAllocator.KPSAllocator.Load(Boolean hotReload) in /home/runner/work/kps-allocator/kps-allocator/src/KPSAllocator.cs:line 46
at CounterStrikeSharp.API.Core.Plugin.PluginContext.Load(Boolean hotReload) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/PluginContext.cs:line 216
at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.LoadPlugin(String path) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 56
at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.Load() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 38

image

I'm using mariadb (Your MariaDB connection id is 62
Server version: 11.0.5-MariaDB-1:11.0.5+maria~deb11 mariadb.org binary distribution)

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.