add ExtendHumiliation.smx

This commit is contained in:
Robin Appelman 2024-10-09 22:33:05 +02:00
commit 8a550ef88c
8 changed files with 163 additions and 1 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
result
.direnv

View file

@ -1,7 +1,7 @@
from spiretf/docker-tf2-server
maintainer Robin Appelman <robin@icewind.nl>
ADD ./socket_3.0.1.zip /
ADD ./socket_3.0.1.zip ./ExtendHumiliation.smx /
ADD ./maps.sh ./sourcemod.sh ./plugins.sh ./configs.sh $SERVER/
RUN $SERVER/maps.sh \
&& $SERVER/sourcemod.sh \

BIN
ExtendHumiliation.smx Normal file

Binary file not shown.

40
ExtendHumiliation.sp Normal file
View file

@ -0,0 +1,40 @@
public Plugin:myinfo =
{
name = "Bonus Round Time Extend",
author = "Mr. Random",
description = "Create cvars to extend bonusroundtime beyond 15 sec.",
version = "1.0",
url = ":("
}
new Handle:gBonusRoundTime = INVALID_HANDLE;
new Int:bonustime = 0;
ConVar g_cvTime;
public OnPluginStart() {
CreateTimer(1.0, UpdateCvar, _, TIMER_REPEAT);
gBonusRoundTime = FindConVar("mp_bonusroundtime");
g_cvTime = CreateConVar("bonus_time", "15", "The length of bonus round time");
if (gBonusRoundTime != INVALID_HANDLE)
{
SetConVarBounds(gBonusRoundTime, ConVarBound_Upper, true, g_cvTime.FloatValue);
ServerCommand("sm_cvar","mp_bonusroundtime",g_cvTime.FloatValue);
}
else
{
PrintToServer("Cvar failed to be acquired");
//somehow tell sourcemod the plugin has crashed.
}
}
public Action UpdateCvar(Handle timer)
{
bonustime = g_cvTime.IntValue;
if (gBonusRoundTime != INVALID_HANDLE)
{
SetConVarBounds(gBonusRoundTime, ConVarBound_Upper, true, g_cvTime.FloatValue);
ServerCommand("mp_bonusroundtime %d", bonustime);
}
}

84
flake.lock generated Normal file
View file

@ -0,0 +1,84 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1728502498,
"narHash": "sha256-PcHsk4n1cKYBePd6mmu/OkC/AqKlocYRpXQv3OlzasA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7e1395464c01adb6be404b315202366f73305ace",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "release-24.05",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"spire": "spire",
"utils": "utils"
}
},
"spire": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": [
"utils"
]
},
"locked": {
"lastModified": 1711219822,
"narHash": "sha256-gVxfFaWqK04qIqjGIZnGWE/0QTr5wZdeGudlGqnDfVI=",
"owner": "spiretf",
"repo": "nix",
"rev": "6007526a96065796476a0b489fe0e259adae1bb9",
"type": "github"
},
"original": {
"owner": "spiretf",
"repo": "nix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

31
flake.nix Normal file
View file

@ -0,0 +1,31 @@
{
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/release-24.05";
spire.url = "github:spiretf/nix";
spire.inputs.nixpkgs.follows = "nixpkgs";
spire.inputs.utils.follows = "utils";
};
outputs = {
self,
nixpkgs,
utils,
spire,
}:
utils.lib.eachSystem spire.systems (system: let
overlays = [spire.overlays.default];
pkgs = (import nixpkgs) {
inherit system overlays;
};
inherit (pkgs) lib;
spEnv = pkgs.sourcepawn.buildEnv (with pkgs.sourcepawn.includes; [sourcemod]);
in rec {
packages = rec {
inherit spEnv;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [spEnv];
};
});
}

View file

@ -95,6 +95,10 @@ wget -nv https://github.com/spiretf/setteam/raw/master/plugin/setteam.smx
# proper-pregame
wget -nv https://github.com/AJagger/ProperPregame/raw/master/addons/sourcemod/plugins/properpregame.smx
# ExtendHumiliation
cp /ExtendHumiliation.smx .
chmod 0664 *.smx
printf "\nsm plugins unload properpregame\n" >> $HOME/hlserver/tf2/tf/cfg/sourcemod/soap_live.cfg