Zombie Mode для CS2, який посилається на функції та можливості попереднього плагіна SourcePawn Zombie:Reloaded. Можна сказати, що це рімейк Zombie:Reloaded, але на C#. Ось список функцій.
Особливість Zombie-Sharp
Базова початкова атака зомбі-інфекції з таймером
Цикл матері-зомбі
Зараження та людське командування
Опція перемикання відродження
Модуль класу гравця
Модуль зброї з командою купівлі.
Модуль Hitgroups (буде додано пізніше)
Модуль відбиття
Модуль ZTeleport
Конфігурація для параметрів зараження (ConVar)
Гроші за пошкодження зомбі
API для зовнішнього плагіна
Ефект гранати-напалму
Встановлення
Встановіть збірку Metamod та CounterStrikeSharp with Runtime.
Перетягніть усі файли з zip-архіву до
game/csgo.Виконання налаштування команд та конфігурації файлів.
Запускайте сервер і насолоджуйтесь.
Налаштування команди
Рекомендується налаштувати ці Convar перед використанням плагіна, щоб запобігти збоям та можливим проблемам.
// set in server.cfg
mp_limitteams 0
mp_autoteambalance 0
// set in gamemode_casual_server.cfg if file is not existed copy gamemode_casual.cfg and rename it.
mp_disconnect_kills_players 1
mp_roundtime 3 // set it to round time that you want.
mp_roundtime_hostage 0 // this will override mp_roundtime in the map "cs_" if value is more than 0.
mp_roundtime_defuse 0 // this will override mp_roundtime in the map "de_" if value is more than 0.
Приклад API
Перегляньте ZombieTest для прикладів використання інших API.
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Capabilities;
using ZombieSharpAPI;
namespace ZombieTest
{
public class ZombieTest : BasePlugin
{
public override string ModuleName => "Zombie Test";
public override string ModuleVersion => "1.0";
// Declare Capability First.
public static PluginCapability<IZombieSharpAPI> ZombieCapability { get; } = new("zombiesharp:core");
// Declare API class
IZombieSharpAPI? API;
public override void OnAllPluginsLoaded(bool hotReload)
{
// Get Capability.
API = ZombieCapability.Get()!;
// Excute Hook function
API.OnClientInfect += ZS_OnInfectClient;
}
// Hook function is here.
public HookResult ZS_OnInfectClient(CCSPlayerController client, CCSPlayerController attacker, bool motherzombie, bool force)
{
// check which client is infect.
Server.PrintToChatAll($"{client.PlayerName} is infected");
// if client name is Oylsister
if (client.PlayerName == "Oylsister")
{
Server.PrintToChatAll("Oylsister is immunity");
// Blocking infected
return HookResult.Handled;
}
if (force)
Server.PrintToChatAll($"by forcing.");
// Always use HookResult.Continue to allowing other player get infect as usual.
return HookResult.Continue;
}
}
}Конфігурація
Ось список усіх доступних файлів конфігурації та їх функцій.
gamesettings.jsonc – Базовий таймер зараження та інші налаштування, які ви можете встановити. Цей файл існує для застосування налаштувань гри у випадку, якщо ConVar не вдасться виконати.
{
"FirstInfectionTimer": 15.0, // First infection delaying in seconds
"MotherZombieRatio": 7.0, // First mother zombie ratio (21 players / 7 ratio = 3 motherzombie will spawned.)
"MotherZombieTeleport": false, // Teleport mother zombie back to spawn after infection (Zombie Escape stuff)
"CashOnDamage": false, // Turn damage into cash for human.
"TimeoutWinner": 1, // When round time end specific team will win (0 = zombie | 1 = human.)
"DefaultHumanBuffer": "human_default", // human class unique name for default class
"DefaultZombieBuffer": "zombie_default", // zombie class unique name for default class
"MotherZombieBuffer": "motherzombie", // mother zombie class unique name for default class
"RandomClassesOnConnect": false, // random class on join or not.
"RandomClassesOnSpawn": true, // random class on every player respawn.
"WeaponPurchaseEnable": true, // Enable purchase via command or not. This also will toggle weapon purchase limit too.
"WeaponRestrictEnable": true, // Restrict specific weapon or not.
"WeaponBuyZoneOnly": false, // Only allow player to purchase weapon in buyzone.
"TeleportAllow": true, // allow using !ztele to teleport back to spawn point.
"RespawnEnable": true, // allow respawn after death or not
"RespawnDelay": 5.0, // respawn delay obviously
"AllowRespawnJoinLate": false, // allow player to join during the round and respawn into the game or not.
"RespawnTeam": 0 // 1 for human team | 0 for zombie team | 2 for player's they were before death.
}weapons.jsonc – Налаштування певних параметрів зброї. А також параметри покупки.
{
"glock": { // The weaponname get from event when get fired.
"WeaponName": "Glock", // weapon name you wish
"WeaponEntity": "weapon_glock", // weapon entity
"Knockback": 1.1, // knockback
"WeaponSlot": 1, // weaponslot (0 = Primary, 1 = Secondary, 2 = knife, 3 = grenade)
"Price": 200, // price you want
"MaxPurchase": 0, // Allowing how many time client to purchase in one live.
"Restrict": false, // Allow client to use or not.
"PurchaseCommand": [ "css_glock", "css_gs" ] // Purchase command. Set whatever you want.
}
}playerclasses.jsonc - Конфігурація класів гравців. Розміщення користувацької моделі game/csgo як для сервера, так і для клієнта (гравця)
Приклад:game/csgo/characters/models/nozb1/2b_nier_automata_player_model/2b_nier_player_model.vmdl_c
{
"human_default": { // Class unique name
"Name": "Human Default", // class name
"Enable": true, // enable it or not
"Team": 1, // Team 0 = zombie, Team 1 = human
"Model": "characters\\models\\nozb1\\2b_nier_automata_player_model\\2b_nier_player_model.vmdl", // Model path for this class change .vmdl_c to .vmdl in this config
"MotherZombie": false, // Specify if this class is for mother zombie.
"Health": 150, // class health
"Regen_Interval": 1.0, // Regen_Interval is the time in seconds between each regen tick
"Regen_Amount": 3, // Regen_Amount is the amount of health to regen each tick
"Napalm_Time": 0, // Duration of Napalm grenade, set to 0 meaning no burn.
"Speed": 250.0, // class speed (not work yet)
"Knockback": 0.0, // class knockback
}
}hitgroups.jsonc – конфігурація Hitgroup для відбиття.
{
"Generic": { // name doesn't effect anything
"Index": 0, // do not edit this part.
"Knockback": 1.0 // you can change knockback to whatever you want.
},
"Head": {
"Index": 1,
"Knockback": 1.2
},
"Chest": {
"Index": 2,
"Knockback": 1.0
},
"Stomach": {
"Index": 3,
"Knockback": 1.0
}
}
Приєднуйтесь до обговорення
Ви можете написати зараз та зареєструватися пізніше. Якщо у вас є обліковий запис, авторизуйтесь, щоб опублікувати від імені свого облікового запису.