├── README.md ├── reserved.ini └── slot.lua /README.md: -------------------------------------------------------------------------------- 1 | # Important 2 | This script is outdated(buggy) for some works for some doesn't . I implemented better version in this [Script](https://github.com/justMemou/cs2-admin) 3 | 4 | # Cs2-ReservedSlots 5 | 6 | This is a lua script for CS2 for Reserved Slots 7 | 8 | ## Installation 9 | 10 | - Install [Lua Unlocker](https://github.com/Source2ZE/LuaUnlocker) 11 | 12 | - Extract the package contents into `game/csgo` on your server 13 | 14 | - Add this in server.cfg: 15 | ```bash 16 | script_reload_code slot 17 | ``` 18 | ## Configuration 19 | 20 | - If you want to give someone Slot Access edit the `reserved.ini` file in `scripts\configs` 21 | - If you want to change how many slots are Non Reserved you can do it from here `scripts\vscripts\slot.lua` 22 | 23 | ## Support 24 | 25 | * If you want to Support me you can do it here [Paypal](https://www.paypal.com/paypalme/martipartydev) [Revolut](https://revolut.me/martoparto) 26 | -------------------------------------------------------------------------------- /reserved.ini: -------------------------------------------------------------------------------- 1 | "Reserved" 2 | { 3 | "" //steamID3 here. delete this 4 | } 5 | -------------------------------------------------------------------------------- /slot.lua: -------------------------------------------------------------------------------- 1 | print("Resserved slots!") 2 | 3 | local reservedlist 4 | local kv = LoadKeyValues("scripts/configs/reserved.ini") 5 | local slots = 28 --Non Resserved Slots| You can change this | Example: If the server is 32 slots in this case: you will have 4 resserved slots| 6 | 7 | function Adverts_LoadAdvertsConfig() 8 | print("list start") 9 | 10 | 11 | if kv ~= nil then 12 | reservedlist = {} 13 | for k, v in pairs(kv) do 14 | table.insert(reservedlist, v) 15 | print("Added: " .. v) 16 | end 17 | 18 | return reservedlist 19 | else 20 | print("Couldn't load config file (scripts/configs/reserved.ini). Adverts script wasn't started.") 21 | return {} 22 | end 23 | end 24 | 25 | 26 | function CheckReserved(event) 27 | local player = Entities:FindAllByClassname("player") 28 | local players = 0 29 | for _ in pairs(player) do 30 | players = players + 1 31 | end 32 | if GetMapName() ~= "" then 33 | DeepPrintTable(event) 34 | if (players > slots) then 35 | for _, id in ipairs(reservedlist) do 36 | if (id ~= event.networkid) then 37 | SendToServerConsole("kickid " .. event.userid .. "You need Slot access!") 38 | end 39 | end 40 | end 41 | end 42 | end 43 | 44 | 45 | 46 | function Activate() 47 | Adverts_LoadAdvertsConfig() 48 | ListenToGameEvent("player_connect", CheckReserved, nil) 49 | end 50 | 51 | Activate() 52 | --------------------------------------------------------------------------------