This commit is contained in:
Juzlus 2025-09-25 04:06:00 +02:00
parent 555fc45d08
commit d68896f181
22 changed files with 338 additions and 106 deletions

View file

@ -40,6 +40,7 @@ namespace src.command
{ SplitCommands(config.NormalCommands.UseSkillCommand.Alias), ("Use/Type skill", Command_UseTypeSkill) },
{ SplitCommands(config.NormalCommands.ConsoleCommand.Alias), ("Console command", Command_CustomCommand) },
{ SplitCommands(config.NormalCommands.HealCommand.Alias), ("Heal", Command_Heal) },
{ SplitCommands(config.NormalCommands.HudCommand.Alias), ("Enable/Disable HUD", Command_HUD) },
{ SplitCommands(config.NormalCommands.SetStaticSkillCommand.Alias), ("Set static skill", Command_SetStaticSkill) },
{ SplitCommands(config.NormalCommands.ChangeLanguageCommand.Alias), ("Change language", Command_ChangeLanguage) },
{ SplitCommands(config.NormalCommands.ReloadCommand.Alias), ("Reaload configs", Command_Reload) },
@ -324,6 +325,21 @@ namespace src.command
player.PrintToChat($" {ChatColors.Green}{player.GetTranslation("healed")}");
}
[CommandHelper(minArgs: 0, whoCanExecute: CommandUsage.CLIENT_ONLY)]
private static void Command_HUD(CCSPlayerController? player, CommandInfo command)
{
Debug.WriteToDebug($"Player {player?.PlayerPawn} used the css_hud {command.ArgString} command.");
if (player == null || !player.IsValid || player.PlayerPawn.Value == null || !player.PlayerPawn.Value.IsValid) return;
if (!AdminManager.PlayerHasPermissions(player, config.NormalCommands.HudCommand.Permissions)) return;
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
if (playerInfo == null) return;
playerInfo.DisplayHUD = !playerInfo.DisplayHUD;
SkillUtils.CloseMenu(player);
player.PrintToChat($" {(playerInfo.DisplayHUD ? ChatColors.Green : ChatColors.Red)}{player.GetTranslation(playerInfo.DisplayHUD ? "hud_on" : "hud_off")}");
}
[CommandHelper(minArgs: 2, whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
private static void Command_SetScore(CCSPlayerController? player, CommandInfo command)
{
@ -485,13 +501,23 @@ namespace src.command
Localization.Load();
Load();
foreach (var skill in SkillData.Skills)
skill.Color = SkillsInfo.GetValue<string>(skill.Skill, "color");
SkillData.Skills.Clear();
foreach (var skill in Enum.GetValues(typeof(Skills)))
if (SkillsInfo.GetValue<bool>(skill, "active"))
Instance.SkillAction(skill.ToString()!, "LoadSkill");
if (player != null && player.IsValid)
player.PrintToChat($" {ChatColors.Green}{player.GetTranslation("reload")}");
else
Server.PrintToConsole($" {ChatColors.Green}{Localization.GetTranslation("reload")}");
foreach (var target in Instance.SkillPlayer)
{
if (SkillsInfo.GetValue<bool>(target.Skill, "active") == false)
target.Skill = Event.noneSkill.Skill;
if (SkillsInfo.GetValue<bool>(target.SpecialSkill, "active") == false)
target.SpecialSkill = Event.noneSkill.Skill;
}
}
}
}

View file

@ -25,7 +25,7 @@ namespace src
public override string ModuleName => "[CS2] [ jRandomSkills ]";
public override string ModuleAuthor => "D3X, Juzlus";
public override string ModuleDescription => "Plugin adds random skills every round for CS2 by D3X. Modified by Juzlus.";
public override string ModuleVersion => "1.1.7";
public override string ModuleVersion => "1.1.8";
public override void Load(bool hotReload)
{
@ -104,6 +104,7 @@ namespace src
public bool IsDrawing { get; set; }
public DateTime SkillDescriptionHudExpired { get; set; }
public string? PrintHTML { get; set; }
public bool DisplayHUD { get; set; }
}
public class jSkill_SkillInfo(Skills skill, string color, bool display)

View file

@ -438,6 +438,8 @@
"healed": "You have been healed.",
"game_start": "Game started!",
"reload": "Languages and configs have been reloaded.",
"hud_on": "HUD has been enabled.",
"hud_off": "HUD has been disabled.",
"vote_started": "Vote started: '{0}'",
"vote_timeout": "Vote '{0}' timed out!",

View file

@ -438,6 +438,8 @@
"healed": "Vous avez été soigné.",
"game_start": "La partie a commencé !",
"reload": "Les langues et configurations ont été rechargées.",
"hud_on": "Le HUD a été activé.",
"hud_off": "Le HUD a été désactivé.",
"vote_started": "Vote lancé : « {0} »",
"vote_timeout": "Le vote « {0} » a expiré !",

View file

@ -438,6 +438,8 @@
"healed": "Zostałeś uleczony.",
"game_start": "Gra rozpoczęta!",
"reload": "Tłumaczenia i konfigi zostały ponownie załadowane.",
"hud_on": "HUD został włączony.",
"hud_off": "HUD został wyłączony.",
"vote_started": "Głosowanie rozpoczęte: '{0}'",
"vote_timeout": "Głosowanie '{0}' przekroczyło limit czasu!",

View file

@ -438,6 +438,8 @@
"healed": "Você foi curado.",
"game_start": "Jogo iniciado!",
"reload": "Os idiomas e as configurações foram recarregados.",
"hud_on": "O HUD foi ativado.",
"hud_off": "O HUD foi desativado.",
"vote_started": "Votação iniciada: '{0}'",
"vote_timeout": "Votação '{0}' expirou!",

View file

@ -438,6 +438,8 @@
"healed": "你已被治疗。",
"game_start": "游戏开始!",
"reload": "语言和配置已重新加载。",
"hud_on": "HUD已启用。",
"hud_off": "HUD已禁用。",
"vote_started": "投票开始:'{0}'",
"vote_timeout": "投票'{0}'超时!",

View file

@ -283,6 +283,8 @@ namespace src.player
SpecialSkill = Skills.None,
IsDrawing = false,
SkillChance = 1,
PrintHTML = null,
DisplayHUD = true,
});
string welcomeMsg = player.GetTranslation("welcome_message", "welcome");
@ -385,6 +387,24 @@ namespace src.player
}
});
}
if (Config.LoadedConfig.DisableSkillsOnRoundEnd)
{
isTransmitRegistered = false;
Instance.AddTimer(1f, () =>
{
DisableAll();
foreach (var player in Utilities.GetPlayers().Where(p => p.IsValid && !p.IsBot && !p.IsHLTV && p.Team is CsTeam.CounterTerrorist or CsTeam.Terrorist))
{
var skillPlayer = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
if (skillPlayer == null) continue;
skillPlayer.Skill = noneSkill.Skill;
skillPlayer.SpecialSkill = noneSkill.Skill;
skillPlayer.PrintHTML = null;
}
});
Instance.RemoveListener<CheckTransmit>(CheckTransmit);
}
return HookResult.Continue;
}
}
@ -559,6 +579,7 @@ namespace src.player
if (randomSkill.Display)
SkillUtils.PrintToChat(player, $"{ChatColors.DarkRed}{player.GetSkillName(randomSkill.Skill)}{ChatColors.Lime}: {player.GetSkillDescription(randomSkill.Skill)}", false);
Instance?.SkillAction(skillPlayer.Skill.ToString(), "DisableSkill", [player]);
skillPlayer.Skill = randomSkill.Skill;
skillPlayer.SpecialSkill = Skills.None;

View file

@ -1,5 +1,6 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Admin;
using CounterStrikeSharp.API.Modules.Utils;
using src.utils;
using static CounterStrikeSharp.API.Core.Listeners;
@ -48,7 +49,7 @@ namespace src.player
{
if (player == null) return;
var skillPlayer = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
if (skillPlayer == null) return;
if (skillPlayer == null || !skillPlayer.DisplayHUD) return;
string infoLine = "";
string skillLine = "";
@ -86,7 +87,7 @@ namespace src.player
}
} else if (player?.IsValid == true)
{
if (player.Team is CsTeam.Spectator or CsTeam.None && Config.LoadedConfig.DisableSpectateHUD)
if ((player.Team is CsTeam.Spectator or CsTeam.None && Config.LoadedConfig.DisableSpectateHUD) || AdminManager.PlayerHasPermissions(player, Config.LoadedConfig.DisableHUDOnDeathPermission))
return;
var pawn = player.Pawn.Value;

View file

@ -93,7 +93,7 @@ namespace src.player.skills
private static void CreateReplica(CCSPlayerController player)
{
var playerPawn = player.PlayerPawn.Value;
var replica = Utilities.CreateEntityByName<CDynamicProp>("prop_dynamic");
var replica = Utilities.CreateEntityByName<CDynamicProp>("prop_dynamic_override");
if (replica == null || playerPawn == null || !playerPawn.IsValid || playerPawn.AbsOrigin == null || playerPawn.AbsRotation == null)
return;
@ -105,12 +105,12 @@ namespace src.player.skills
replica.Flags = playerPawn.Flags;
replica.Flags |= (uint)Flags_t.FL_DUCKING;
replica.Collision.SolidType = SolidType_t.SOLID_VPHYSICS;
replica.CBodyComponent!.SceneNode!.Owner!.Entity!.Flags = (uint)(replica.CBodyComponent!.SceneNode!.Owner!.Entity!.Flags & ~(1 << 2));
replica.SetModel(playerPawn!.CBodyComponent!.SceneNode!.GetSkeletonInstance().ModelState.ModelName);
replica.Entity!.Name = replica.Globalname = $"Replica_{Server.TickCount}_{(player.Team == CsTeam.CounterTerrorist ? "CT" : "TT")}";
replica.Teleport(pos, playerPawn.AbsRotation, null);
replica.DispatchSpawn();
replica.AcceptInput("EnableCollision");
}
public static void OnTakeDamage(DynamicHook h)
@ -121,18 +121,21 @@ namespace src.player.skills
if (param == null || param.Entity == null || param2 == null || param2.Attacker == null || param2.Attacker.Value == null)
return;
CCSPlayerPawn attackerPawn = new(param2.Attacker.Value.Handle);
if (string.IsNullOrEmpty(param.Entity.Name)) return;
if (!param.Entity.Name.StartsWith("Replica_")) return;
var replica = param.As<CPhysicsPropMultiplayer>();
if (replica == null || !replica.IsValid) return;
replica.EmitSound("GlassBottle.BulletImpact", volume: 1f);
replica.AcceptInput("Kill");
CCSPlayerPawn attackerPawn = new(param2.Attacker.Value.Handle);
if (attackerPawn.DesignerName != "player")
return;
var attackerTeam = attackerPawn.TeamNum;
var replicaTeam = replica.Globalname.EndsWith("CT") ? 3 : 2;
SkillUtils.TakeHealth(attackerPawn, attackerTeam != replicaTeam ? 15 : 5);
replica.AcceptInput("Kill");
}
public class PlayerSkillInfo

View file

@ -81,6 +81,8 @@ namespace src.utils
public bool DisableSpectateHUD { get; set; }
public bool FlashingHtmlHudFix { get; set; }
public bool CS2TraceRayDebug { get; set; }
public string DisableHUDOnDeathPermission { get; set; }
public bool DisableSkillsOnRoundEnd { get; set; }
public LanguageSystem LanguageSystem { get; set; }
public HtmlHudCustomisation HtmlHudCustomisation { get; set; }
public NormalCommands NormalCommands { get; set; }
@ -100,6 +102,8 @@ namespace src.utils
FlashingHtmlHudFix = true;
CS2TraceRayDebug = false;
DisableSpectateHUD = false;
DisableHUDOnDeathPermission = "@jRandmosSkills/death";
DisableSkillsOnRoundEnd = false;
LanguageSystem = new LanguageSystem
{
@ -141,7 +145,8 @@ namespace src.utils
SkillsListCommand = new NormalCommand("supermoc, skille, listamocy, supermoce, skills, listaHabilidades, habilidades, 技能列表, 超能力列表", "@jRandmosSkills/admin"),
UseSkillCommand = new NormalCommand("t, useSkill, usarHabilidade, 技能使用, 使用技能", "@jRandmosSkills/admin"),
HealCommand = new NormalCommand("heal, ulecz, curar, tratar, 治疗, 治愈", "@jRandmosSkills/admin"),
ConsoleCommand = new NormalCommand("console, sv, 控制台, 服务器", "@jRandmosSkills/root"),
ConsoleCommand = new NormalCommand("console, sv, 控制台, 服务器", "@jRandmosSkills/owner"),
HudCommand = new NormalCommand("hud, hood", ""),
SetStaticSkillCommand = new NormalCommand("ustawstatycznyskill, ustaw_statyczny_skill, setstaticskill, set_static_skill", "@jRandmosSkills/admin"),
ChangeLanguageCommand = new NormalCommand("lang, language, changelang, change_lang, jezyk, język", ""),
ReloadCommand = new NormalCommand("reload, refresh", "@jRandmosSkills/admin"),
@ -154,7 +159,7 @@ namespace src.utils
SwapCommand = new VotingCommand(true, "swap, zmiana, trocar, 交换, 切换", "@jRandmosSkills/admin", 15, 90, 15, 20, 2),
ShuffleCommand = new VotingCommand(true, "shuffle, embaralhar, 随机排序, 洗牌", "@jRandmosSkills/admin", 15, 90, 15, 20, 2),
PauseCommand = new VotingCommand(true, "pause, unpause, pausar, despausar, 暂停, 恢复", "@jRandmosSkills/admin", 15, 60, 15, 2, 2),
SetScoreCommand = new VotingCommand(true, "setscore, wynik, definirPontuacao, configurarPontos, 设置分数, 调整分数", "@jRandmosSkills/root", 15, 90, 15, 90, 2),
SetScoreCommand = new VotingCommand(true, "setscore, wynik, definirPontuacao, configurarPontos, 设置分数, 调整分数", "@jRandmosSkills/owner", 15, 90, 15, 90, 2),
};
}
}
@ -205,6 +210,7 @@ namespace src.utils
public required NormalCommand UseSkillCommand { get; set; }
public required NormalCommand HealCommand { get; set; }
public required NormalCommand ConsoleCommand { get; set; }
public required NormalCommand HudCommand { get; set; }
public required NormalCommand SetStaticSkillCommand { get; set; }
public required NormalCommand ChangeLanguageCommand { get; set; }
public required NormalCommand ReloadCommand { get; set; }

View file

@ -201,7 +201,7 @@ namespace src.utils
if (player == null || !player.IsValid) return;
var playerInfo = jRandomSkills.Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
if (playerInfo == null) return;
if (playerInfo == null || !playerInfo.DisplayHUD) return;
var skillData = SkillData.Skills.FirstOrDefault(s => s.Skill == playerInfo.Skill);
if (skillData == null) return;

View file

@ -11,6 +11,8 @@
"DisableSpectateHUD": false,
"FlashingHtmlHudFix": true,
"CS2TraceRayDebug": false,
"DisableHUDOnDeathPermission": "@jRandmosSkills/death",
"DisableSkillsOnRoundEnd": false,
"LanguageSystem": {
"DefaultLangCode": "en",
"DisableGeoLite": false,
@ -74,7 +76,11 @@
},
"ConsoleCommand": {
"Alias": "console, sv, 控制台, 服务器",
"Permissions": "@jRandmosSkills/root"
"Permissions": "@jRandmosSkills/owner"
},
"HudCommand": {
"Alias": "hud, hood",
"Permissions": ""
},
"SetStaticSkillCommand": {
"Alias": "ustawstatycznyskill, ustaw_statyczny_skill, setstaticskill, set_static_skill",
@ -150,7 +156,7 @@
"TimeToNextSameVoting": 90.0,
"MinimumPlayersToStartVoting": 2,
"Alias": "setscore, wynik, definirPontuacao, configurarPontos, 设置分数, 调整分数",
"Permissions": "@jRandmosSkills/root"
"Permissions": "@jRandmosSkills/owner"
}
}
}

View file

@ -438,6 +438,8 @@
"healed": "You have been healed.",
"game_start": "Game started!",
"reload": "Languages and configs have been reloaded.",
"hud_on": "HUD has been enabled.",
"hud_off": "HUD has been disabled.",
"vote_started": "Vote started: '{0}'",
"vote_timeout": "Vote '{0}' timed out!",

View file

@ -438,6 +438,8 @@
"healed": "Vous avez été soigné.",
"game_start": "La partie a commencé !",
"reload": "Les langues et configurations ont été rechargées.",
"hud_on": "Le HUD a été activé.",
"hud_off": "Le HUD a été désactivé.",
"vote_started": "Vote lancé : « {0} »",
"vote_timeout": "Le vote « {0} » a expiré !",

View file

@ -438,6 +438,8 @@
"healed": "Zostałeś uleczony.",
"game_start": "Gra rozpoczęta!",
"reload": "Tłumaczenia i konfigi zostały ponownie załadowane.",
"hud_on": "HUD został włączony.",
"hud_off": "HUD został wyłączony.",
"vote_started": "Głosowanie rozpoczęte: '{0}'",
"vote_timeout": "Głosowanie '{0}' przekroczyło limit czasu!",

View file

@ -438,6 +438,8 @@
"healed": "Você foi curado.",
"game_start": "Jogo iniciado!",
"reload": "Os idiomas e as configurações foram recarregados.",
"hud_on": "O HUD foi ativado.",
"hud_off": "O HUD foi desativado.",
"vote_started": "Votação iniciada: '{0}'",
"vote_timeout": "Votação '{0}' expirou!",

View file

@ -438,6 +438,8 @@
"healed": "你已被治疗。",
"game_start": "游戏开始!",
"reload": "语言和配置已重新加载。",
"hud_on": "HUD已启用。",
"hud_off": "HUD已禁用。",
"vote_started": "投票开始:'{0}'",
"vote_timeout": "投票'{0}'超时!",

View file

@ -71,7 +71,7 @@ Kupujesz serwer na pukawce? Skorzystaj z mojego [kodu polecającego](https://puk
| Mrok | Nadaje efekt ciemności wybranemu przeciwnikowi | - |
| Deaktywator | Wybierasz gracza, którego supermoc chcesz wyłączyć | - |
| Głuchy | Wybierasz gracza, dla którego chcesz wyłączyć wszystkie dźwięki | - |
| Rozbrojenie | Masz losową szanse na wyrzucenie broni wroga po trafieniu | (65 - 85)% |
| Rozbrojenie | Masz losową szanse na wyrzucenie broni wroga po trafieniu | (20 - 35)% |
| Odległościomierz | Możesz zobaczyć odległość do najbliższego przeciwnika | - |
| Doskok | Wykonaj drugi skok, aby wykonać doskok | - |
| Drakula | Po trafieniu ofiary odzyskujesz zdrowie równe pewnemu procentowi zadanych obrażeń | - |
@ -182,7 +182,7 @@ Kupujesz serwer na pukawce? Skorzystaj z mojego [kodu polecającego](https://puk
- Wypakuj go do folderu `CS2Server/game/csgo/addons/counterstrikesharp/`
5. Zainstaluj **jRandomSkills**
- Pobierz [jRandomSkills](https://github.com/Juzlus/jRandomSkills/releases)
- Wypakuj go do folderu `C2Server/game/csgo/addons/counterstrikesharp/plugins/`
- Wypakuj go do folderu `C2Server/game/csgo/addons/counterstrikesharp/`
- JEŚLI do pobrania jest plik `gamedata.json`:
- Wypakuj `gamedata.json` do folderu `C2Server/server/game/csgo/addons/counterstrikesharp/gamedata/`
@ -202,12 +202,13 @@ Kupujesz serwer na pukawce? Skorzystaj z mojego [kodu polecającego](https://puk
| `!map <mapWorkshopId>` | `!map 3332005394` | Zmiana mapy z warsztatu | `@jRandmosSkills/admin` |
| `!start` | `!start` | Rozpoczęcie gry z parametrami: `mp_forcecamera 0, mp_freezetime 15, mp_overtime_enable 1, sv_cheats 0` | `@jRandmosSkills/admin` |
| `!start sv` | `!start sv` | Rozpoczęcie gry z parametrami: `mp_forcecamera 0, mp_freezetime 0, mp_overtime_enable 1, sv_cheats 1` | `@jRandmosSkills/admin` |
| `!console <command>` | `!console sv_cheats 1` | Uruchomienie komendy na serwerze | `@jRandmosSkills/root` |
| `!console <command>` | `!console sv_cheats 1` | Uruchomienie komendy na serwerze | `@jRandmosSkills/owner` |
| `!swap` | `!swap` | Zamiana stron | `@jRandmosSkills/admin` |
| `!shuffle` | `!shuffle` | Losowe dobranie graczy do drużyn | `@jRandmosSkills/admin` |
| `!pause` | `!pause` | Wstrzymanie gry | `@jRandmosSkills/admin` |
| `!heal` | `!heal` | Przywrócenie 100 punktów zdrowia | `@jRandmosSkills/root` |
| `!setscore <CT> <TT>` | `!setscore 10 7` | Ustawienie wyniku gry | `@jRandmosSkills/root` |
| `!heal` | `!heal` | Przywrócenie 100 punktów zdrowia | `@jRandmosSkills/admin` |
| `!hud` | `!hud` | Włącz/Wyłącz HUD | - |
| `!setscore <CT> <TT>` | `!setscore 10 7` | Ustawienie wyniku gry | `@jRandmosSkills/owner` |
| `!setstaticskill <playerName/steamID> <skill>` | `!setstaticskill Juzlus Aimbot` | Przypisanie supermocy do gracza na stałe | `@jRandmosSkills/admin` |
| `!setstaticskill <playerName/steamID> None` | `!setstaticskill Juzlus None` | Powrót do normalności | `@jRandmosSkills/admin` |
| `!reload` | `!reload` | Odśwież tłumaczenia | - |
@ -223,7 +224,7 @@ Aby nadać uprawnienia administracyjne w CounterStrikeSharp:
{
"Juzlus": {
"identity": "STEAM_0:0:94913632",
"flags": ["@jRandmosSkills/admin", "@jRandmosSkills/root"]
"flags": ["@jRandmosSkills/admin", "@jRandmosSkills/owner"]
}
}
```
@ -231,50 +232,73 @@ Aby nadać uprawnienia administracyjne w CounterStrikeSharp:
3. Zapisz plik i uruchom serwer, aby zastosować zmiany.
## ⚙️ Konfiguracja
Wszystkie sypermoce można dostosować w pliku **`Config.cfg`** znajdującym się w folderze **`game/csgo/addons/counterstrikesharp/plugins/jRandomSkills/`**
Wszystkie sypermoce można dostosować w pliku **`config.cfg`** / **`skillsInfo.json`** znajdującym się w folderze **`game/csgo/addons/counterstrikesharp/plugins/jRandomSkills/configs/`**
- ##### config.json
```json
{
"Settings": {
"LangCode": "en", // Język pluginu: en, pl, pt-br, zh
"GameMode": 3, // Tryb gry:
// 0 - Losowa supermoc dla każdego gracza (Brak powtórek z rzędu)
// 1 - Ta sama supermoc dla całej drużyny
// 2 - Ta sama supermoc dla wszystkich graczy
// 3 - Losowa supermoc dla każdego gracza (Brak powtórek na mapie)
// 4 - Debug: Supormoce są przydzielane po kolei
"KillerSkillInfo": true, // Pokazuj supermoc zabójcy na czacie
"TeamMateSkillInfo": true, // Pokazuj supermoc sojuszników na czacie
"SummaryAfterTheRound": true, // Pokazuj podsumowanie z ostatniej rundy
"DebugMode": true, // Zapisuj aktywność do folderu 'Debug'
"AlternativeSkillButton": null, // Możliwe przyciski:
// null, "Attack", "Jump", "Duck", "Forward", "Back",
// "Use", "Cancel", "Left", "Right", "Moveleft",
// "Moveright", "Attack2", "Run", "Reload", "Alt1",
// "Alt2", "Speed", "Walk", "Zoom", "Weapon1",
// "Weapon2", "Bullrush", "Grenade1", "Grenade2",
// "Attack3", "Scoreboard", "Inspect"
"SkillTimeBeforeStart": 7.0, // Ile sekund przed końcem freeze time należy zakończyć
// losowanie umiejętności? (freezetime - SkillTimeBeforeStart)
"SkillDescriptionDuration": 7.0,// Jak długo opis umiejętności powinien być widoczny?
"DisableSpectateHUD": false, // Wyłącz HUD HTML bedąc martwym
"FlashingHtmlHudFix": true, // Włącz FlashingHtmlHudFix
"CS2TraceRayDebug": false, // Włącz widoczność ścieżki dla LongKnife, LongZeus
...
},
"SkillsInfo": [
{
"NeedsTeammates": false, // Wymaga innych graczy w drużynie
"OnlyTeam": 0, // Dostępność supermocy:
// 0 - Wszyscy
// 2 - Terrorist
// 3 - CounterTerrorist
"Color": "#ff0000", // Kolor supermocy
"Active": true, // Włączona przy uruchamianiu
"Name": "Aimbot" // Nazwa supermocy
"GameMode": 3, // Tryb gry:
// 0 - Losowa supermoc dla każdego gracza (Brak powtórek z rzędu)
// 1 - Ta sama supermoc dla całej drużyny
// 2 - Ta sama supermoc dla wszystkich graczy
// 3 - Losowa supermoc dla każdego gracza (Brak powtórek na mapie)
// 4 - Debug: Supormoce są przydzielane po kolei
"KillerSkillInfo": true, // Pokazuj supermoc zabójcy na czacie
"TeamMateSkillInfo": true, // Pokazuj supermoc sojuszników na czacie
"SummaryAfterTheRound": true, // Pokazuj podsumowanie z ostatniej rundy
"DebugMode": true, // Zapisuj aktywność do folderu 'Debug'
"AlternativeSkillButton": null, // Możliwe przyciski:
// null, "Attack", "Jump", "Duck", "Forward", "Back",
// "Use", "Cancel", "Left", "Right", "Moveleft",
// "Moveright", "Attack2", "Run", "Reload", "Alt1",
// "Alt2", "Speed", "Walk", "Zoom", "Weapon1",
// "Weapon2", "Bullrush", "Grenade1", "Grenade2",
// "Attack3", "Scoreboard", "Inspect"
"SkillTimeBeforeStart": 7.0, // Ile sekund przed końcem freeze time należy zakończyć
// losowanie umiejętności? (freezetime - SkillTimeBeforeStart)
"SkillDescriptionDuration": 7.0, // Jak długo opis umiejętności powinien być widoczny?
"DisplayAlwaysDescription":false,// Zawsze wyświetlaj opis umiejętności
"DisableSpectateHUD": false, // Wyłącz HUD HTML bedąc martwym
"FlashingHtmlHudFix": true, // Włącz FlashingHtmlHudFix
"CS2TraceRayDebug": false, // Włącz widoczność ścieżki dla 'Długi Nóż', 'Długi Zeus'
"DisableHUDOnDeathPermission": "@jRandmosSkills/death", // Wyłącz HUD po śmierci dla graczy z tym uprawnieniem
"DisableSkillsOnRoundEnd": false,// Wyłącz wszystkie umiejętności na koniec rundy (gdy widoczne jest podsumowanie)
"LanguageSystem": {
"DefaultLangCode": "en", // Język domyślny: en, pl, fr, pt-br, zh
"DisableGeoLite": false, // Wyłącz wyszukiwanie języka gracza według geolokalizacji GeoLite2 (MaxMind)
"LanguageInfos": [...] // Ustawienie zmiany języków ISO na tłumaczenia
},
...
]
"HtmlHudCustomisation": { // Ustawienia zmiany kolorów i rozmiarów czcionek
... // xxxl: 64px, xxl: 40px, xl: 32px
} // l: 24px, ml: 20px, m: 18px
... // sm: 16px, s: 12px, xs: 8px
},
```
- ##### skillsInfo.json
```json
[
{
"NeedsTeammates": false, // Wymaga innych graczy w drużynie
"DisableOnFreezeTime": false, // Wyłącz umiejętność podczas freeze time
"OnlyTeam": 0, // Dostępność supermocy:
// 0 - Wszyscy
// 2 - Terrorist
// 3 - CounterTerrorist
"Color": "#ff0000", // Kolor supermocy
"Active": true, // Włączona przy uruchamianiu
"Name": "Aimbot" // Nazwa supermocy
},
...
]
```
- ##### playersLanguage.json
```json
{
"76561198150092992": "pl", // "SteamID": "nazwa pliku tłumaczenia"
...
}
```
@ -290,6 +314,90 @@ Plugin korzysta z zawartości następujących projektów:
## 📋 Lista Zmian
<details>
<summary><b>v1.1.8</b></summary>
- #### Ogólne:
- ###### Dodano opcję `DisableHUDOnDeathPermission` do pliku konfiguracyjnego, aby wyłączyć HUD po śmierci dla graczy posiadających to konkretne uprawnienie.
- ###### Dodano opcję `DisableSkillsOnRoundEnd` do pliku konfiguracyjnego, aby wyłączyć wszystkie umiejętności na koniec rundy (gdy widoczne jest podsumowanie).
- ###### Uprawnienie `@jRandmosSkills/root` zostało zmienione na `@jRandmosSkills/owner`, aby zapobiec problemom z domeną.
- ###### Dodano polecenie `!hud` do włączania/wyłączania HUD (gdy HUD jest wyłączony, menu WSAD nie będzie wyświetlane).
- ###### Wyłączenie pierwszej umiejętności, jeżeli podczas pierwszej rundy wylosowano dwie umiejętności.
- ###### Komenda `!reload` odświeża również status aktywności umiejętności.
- #### Poprawki mocy:
- ##### Replikator:
- ###### Naprawiono błąd powodujący awarie serwera po wybuchu bomby.
- ###### Kolizje replik są teraz bardziej dokładne.
</details>
<details>
<summary><b>v1.1.7</b></summary>
- #### Ogólne:
- ###### Zaktualizowano zależności do najnowszej wersji.
- ###### Informacje o umiejętnościach są teraz dostępne w `skillsInfo.json` zamiast w `config.json`.
- ###### Dodano plik `jRandomSkills.gamedata.json`.
- ###### Dodano opcję wyłączenia konkretnej mocy podczas freeze time (domyślnie wyłączone: Zamiana Miejsc, Odwrót, Replikator, Trutka, Samowolka, Pilot, NoClip, Medyk, Nieśmiertelność, Fortnite, Resp Wroga, Anomalia).
- ###### Dodano opcje `LanguageSystem` do pliku konfiguracyjnego dla szczegółowego zarządzania przypisywaniem języka.
- ###### Komenda `StartGameCommand` ma teraz zmienny parametr startowy w pliku konfiguracyjnym.
- ###### Dodano opcję `DisplayAlwaysDescription` w pliku konfiguracyjnym, aby opis umiejętności był widoczny cały czas.
- ###### Dodano opcje `HtmlHudCustomisation` w pliku konfiguracyjnym do ustawiania kolorów i rozmiaru czcionki.
- ###### Można ustawić pusty tekst: your_skill/drawing_skill/observer_skill/XXX_select_info.
- ###### Opcja ustawienia uzyskanej wartości w nazwie/opisie umiejętności (`{0}`).
- ###### Naprawiono wyświetlanie czasu odnowienia umiejętności (zaokrąglenie w górę).
- ###### Komenda `!reload` odświeża teraz wszystkie parametry ze wszystkich plików konfiguracyjnych.
- ###### Większość kolekcji została zastąpiona strukturami bezpiecznymi dla wątków, aby uniknąć crashy serwera (pomysł: @ebat_kopat777).
- #### Poprawki mocy:
- ##### Długi Nóż:
- ###### Prawy atak nożem również zadaje obrażenia.
- ###### Naprawiono błąd, w którym po śmierci umiejętność gracza była pokazywana jako `Brak`.
- ##### Wallhack:
- ###### Poświaty tworzą się tylko raz, zamiast dla każdego gracza osobno.
- ###### Naprawiono błąd, w którym po śmierci umiejętność gracza była pokazywana jako `Brak`.
- ##### Stópkarz:
- ###### Naprawiono błąd, w którym po śmierci umiejętność gracza była pokazywana jako `Brak`.
- ##### Zamiana Miejsc:
- ###### Dodano konfigurowalny czas blokady na początku rundy.
- ##### Obserwator:
- ###### Zmieniła się metoda poruszania się kamery.
- ##### NoClip:
- ###### Powrót do ostatniego miejsca użycia umiejętności, jeśli gracz spadnie poniżej 3000 jednostek.
- ###### Dodano opcję wyłączenia noclipu, gdy jest aktywny.
- ##### Ninja:
- ###### Naprawiono problem z niewidoczną bronią po śmierci.
- ##### Muhammed:
- ###### Komunikat przy eksplozji jest teraz konfigurowalny (w languages/).
- ###### Naprawiono błąd, w którym granat nie wybuchał.
- ##### Duszek:
- ###### Naprawiono problem z niewidoczną bronią po śmierci.
- ##### Strzał Wybuchowy:
- ###### Naprawiono błąd, w którym granat nie wybuchał.
- ##### Resp Wroga:
- ###### Dodano konfigurowalny czas blokady na początku rundy.
- ##### Rozbrojenie:
- ###### Powrót do upuszczania broni zamiast zmiany na slot3.
- ###### Zmniejszono szansę na upuszczenie broni: (20–50)% → (20–35)%.
- ##### Kurczak:
- ###### Zmieniła się metoda poruszania się kurczaka.
- ###### Gracz widzi model swojego kurczaka.
- ###### Naprawiono hitboxy po powrocie do normalnego modelu.
- ###### Naprawiono błąd, w którym po dezaktywacji umiejętności gracz otrzymywał nadmiarowe HP.
- ##### C4 Kamuflaż:
- ###### Naprawiono problem z niewidoczną bronią po śmierci.
- ##### Mistrz Ostrza:
- ###### Zmniejszono prędkość ruchu z nożem o 10% (konfigurowalne).
- ##### Anty Flash:
- ###### Dodano opcję w pliku konfiguracyjnym, umożliwiającą zmianę czasu trwania błysku twojego flash'a.
- ##### Błazen:
- ###### Naprawiono problem, w którym gracz mógł otrzymywać obrażenia od innych umiejętności lub wybuchu bomby.
- ###### Naprawiono błąd, w którym gracz zawsze był fioletowy.
- ##### Cień:
- ###### Dodano opcję ustawienia szansy na teleportację po trafieniu przeciwnika (w pliku konfiguracyjnym).
- ##### Szpieg:
- ###### Ustawianie modelu gracza po dezaktywacji umiejętności.
- ###### Domyślny model terrorystów został zmieniony.
</details>
<details>
<summary><b>v1.1.6</b></summary>

130
readme.md
View file

@ -184,7 +184,7 @@ Buying a server on pukawka? Use my [referral code](https://pukawka.pl/pp,juzlus.
- Extract it to the `CS2Server/game/csgo/addons/counterstrikesharp/` folder.
5. Install **jRandomSkills**
- Download [jRandomSkills](https://github.com/Juzlus/jRandomSkills/releases)
- Extract it to the `C2Server/game/csgo/addons/counterstrikesharp/plugins/` folder.
- Extract it to the `C2Server/game/csgo/addons/counterstrikesharp/` folder.
- IF there is a `gamedata.json` file to download:
- Extract `gamedata.json` to the `C2Server/server/game/csgo/addons/counterstrikesharp/gamedata/` folder.
@ -204,12 +204,13 @@ Buying a server on pukawka? Use my [referral code](https://pukawka.pl/pp,juzlus.
| `!map <mapWorkshopId>` | `!map 3332005394` | Change map from workshop | `@jRandmosSkills/admin` |
| `!start` | `!start` | Start game with conditions: `mp_forcecamera 0, mp_freezetime 15, mp_overtime_enable 1, sv_cheats 0` | `@jRandmosSkills/admin` |
| `!start sv` | `!start sv` | Start the game with conditions: `mp_forcecamera 0, mp_freezetime 0, mp_overtime_enable 1, sv_cheats 1` | `@jRandmosSkills/admin` |
| `!console <command>` | `!console sv_cheats 1` | Run a command on the server | `@jRandmosSkills/root` |
| `!console <command>` | `!console sv_cheats 1` | Run a command on the server | `@jRandmosSkills/owner` |
| `!swap` | `!swap` | Switch sides | `@jRandmosSkills/admin` |
| `!shuffle` | `!shuffle` | Randomly assign players to teams | `@jRandmosSkills/admin` |
| `!pause` | `!pause` | Pause the game | `@jRandmosSkills/admin` |
| `!heal` | `!heal` | Restore 100 health points | `@jRandmosSkills/root` |
| `!setscore <CT> <TT>` | `!setscore 10 7` | Set the game score | `@jRandmosSkills/root` |
| `!heal` | `!heal` | Restore 100 health points | `@jRandmosSkills/admin` |
| `!hud` | `!hud` | Enable/Disable hud | - |
| `!setscore <CT> <TT>` | `!setscore 10 7` | Set the game score | `@jRandmosSkills/owner` |
| `!setstaticskill <playerName/steamID> <skill>` | `!setstaticskill Juzlus Aimbot` | Giving a player a permanent skill | `@jRandmosSkills/admin` |
| `!setstaticskill <playerName/steamID> None` | `!setstaticskill Juzlus None` | Back to normal | `@jRandmosSkills/admin` |
| `!reload` | `!reload` | Reload translations | - |
@ -225,7 +226,7 @@ To grant administrative permissions in CounterStrikeSharp:
{
"Juzlus": {
"identity": "STEAM_0:0:94913632",
"flags": ["@jRandmosSkills/admin", "@jRandmosSkills/root"]
"flags": ["@jRandmosSkills/admin", "@jRandmosSkills/owner"]
}
}
```
@ -233,50 +234,73 @@ To grant administrative permissions in CounterStrikeSharp:
3. Save the file and restart the server to apply the changes.
## ⚙️ Configuration
All skills can be customized in the **`Config.cfg`** file located in the **`game/csgo/addons/counterstrikesharp/plugins/jRandomSkills/`** folder.
All skills can be customized in the **`config.cfg`** / **`skillsInfo.json`** file located in the **`game/csgo/addons/counterstrikesharp/plugins/jRandomSkills/configs/`** folder.
- ##### config.json
```json
{
"Settings": {
"LangCode": "en", // Plugin language: en, pl, pt-br, zh
"GameMode": 3, // Game mode:
// 0 - Random skills for each player (It can't be the same twice in a row)
// 1 - Same skills for the whole team
// 2 - Same skills for all players
// 3 - Random skills for each player (It can't be the same until the map changes)
// 4 - Debug: Skills are assigned in turn
"KillerSkillInfo": true, // Show killer's skill in chat
"TeamMateSkillInfo": true, // Show allies' skills in chat
"SummaryAfterTheRound": true, // Show summary of the last round
"DebugMode": true, // Write activity to the ‘Debug’ folder
"AlternativeSkillButton": null, // Possible buttons:
// null, "Attack", "Jump", "Duck", "Forward", "Back",
// "Use", "Cancel", "Left", "Right", "Moveleft",
// "Moveright", "Attack2", "Run", "Reload", "Alt1",
// "Alt2", "Speed", "Walk", "Zoom", "Weapon1",
// "Weapon2", "Bullrush", "Grenade1", "Grenade2",
// "Attack3", "Scoreboard", "Inspect"
"SkillTimeBeforeStart": 7.0, // How many seconds before freeze time ends should skills
// drawing be completed? (freezetime - SkillTimeBeforeStart)
"SkillDescriptionDuration": 7.0,// How long should the skill description be visible for?
"DisableSpectateHUD": false, // Disable HTML HUD when spectating
"FlashingHtmlHudFix": true, // Enable FlashingHtmlHudFix
"CS2TraceRayDebug": false, // Enable trail visibility for LongKnife, LongZeus
...
},
"SkillsInfo": [
{
"NeedsTeammates": false, // Requires other players on the team
"OnlyTeam": 0, // Skill availability:
// 0 - Everyone
// 2 - Terrorist
// 3 - CounterTerrorist
"Color": "#ff0000", // Skill color
"Active": true, // Enabled on startup
"Name": "Aimbot" // Skill name
"GameMode": 3, // Game mode:
// 0 - Random skills for each player (It can't be the same twice in a row)
// 1 - Same skills for the whole team
// 2 - Same skills for all players
// 3 - Random skills for each player (It can't be the same until the map changes)
// 4 - Debug: Skills are assigned in turn
"KillerSkillInfo": true, // Show killer's skill in chat
"TeamMateSkillInfo": true, // Show allies' skills in chat
"SummaryAfterTheRound": true, // Show summary of the last round
"DebugMode": true, // Write activity to the ‘Debug’ folder
"AlternativeSkillButton": null, // Possible buttons:
// null, "Attack", "Jump", "Duck", "Forward", "Back",
// "Use", "Cancel", "Left", "Right", "Moveleft",
// "Moveright", "Attack2", "Run", "Reload", "Alt1",
// "Alt2", "Speed", "Walk", "Zoom", "Weapon1",
// "Weapon2", "Bullrush", "Grenade1", "Grenade2",
// "Attack3", "Scoreboard", "Inspect"
"SkillTimeBeforeStart": 7.0, // How many seconds before freeze time ends should skills
// drawing be completed? (freezetime - SkillTimeBeforeStart)
"SkillDescriptionDuration": 7.0, // How long should the skill description be visible for?
"DisplayAlwaysDescription":false,// Always display skill description (SkillDescriptionDuration = 9999)
"DisableSpectateHUD": false, // Disable HTML HUD when spectating
"FlashingHtmlHudFix": true, // Enable FlashingHtmlHudFix
"CS2TraceRayDebug": false, // Enable trail visibility for 'Long Knife', 'Long Zeus'
"DisableHUDOnDeathPermission": "@jRandmosSkills/death", // Disable the HUD after death for players with this permission
"DisableSkillsOnRoundEnd": false,// Disable all skills at the end of the round (when the summary is visible)
"LanguageSystem": {
"DefaultLangCode": "en", // Default language: en, pl, fr, pt-br, zh
"DisableGeoLite": false, // Disable player language search by geolocation GeoLite2 (MaxMind)
"LanguageInfos": [...] // Setting to change ISO languages to translations
},
...
]
"HtmlHudCustomisation": { // Settings for changing colours and font sizes
... // xxxl: 64px, xxl: 40px, xl: 32px
} // l: 24px, ml: 20px, m: 18px
... // sm: 16px, s: 12px, xs: 8px
},
```
- ##### skillsInfo.json
```json
[
{
"NeedsTeammates": false, // Requires other players on the team
"DisableOnFreezeTime": false, // Disable the skill during freeze time
"OnlyTeam": 0, // Skill availability:
// 0 - Everyone
// 2 - Terrorist
// 3 - CounterTerrorist
"Color": "#ff0000", // Skill color
"Active": true, // Enabled on startup
"Name": "Aimbot" // Skill name
},
...
]
```
- ##### playersLanguage.json
```json
{
"76561198150092992": "en", // "SteamID": "name of the translation file"
...
}
```
@ -292,6 +316,22 @@ This plugin uses content from the following projects:
## 📋 Changelog
<details>
<summary><b>v1.1.8</b></summary>
- #### General:
- ###### Added `DisableHUDOnDeathPermission` options to the config, to disable the HUD after death for players with this specific permission.
- ###### Added `DisableSkillsOnRoundEnd` option to the config, to disable all skills at the end of the round (when the summary is visible).
- ###### The permission `@jRandmosSkills/root` has been changed to `@jRandmosSkills/owner` to prevent domain issues.
- ###### Added `!hud` command to toggle the HUD on/off (When the HUD is off, the WSAD Menu will not appear).
- ###### Disabling first skill if two skills are drawn during the first round.
- ###### The `!reload` command also refreshes the skill activity status.
- #### Skill improvements:
- ##### Replicator:
- ###### Fixed a bug causing server crashes after a bomb explosion.
- ###### Replica collisions are now more accurate.
</details>
<details>
<summary><b>v1.1.7</b></summary>
@ -322,7 +362,7 @@ This plugin uses content from the following projects:
- ###### Added a configurable cooldown at the start of the round.
- ##### Spectator:
- ###### The method used to attach the camera has changed.
- ##### Noclip:
- ##### NoClip:
- ###### Return to the last place where you used skill if you fall below 3,000 units.
- ###### Added an option to disable the noclip when it is active.
- ##### Ninja: