Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7504bf2
Updated afk to SM 1.12
F2 Jul 9, 2025
635fde7
Formatting changes
F2 Jul 9, 2025
2c620de
Formatting: Going back to tabs
F2 Jul 9, 2025
49516d1
Updated smlib
F2 Jul 10, 2025
1b7aabf
Updated countdown to SM 1.12
F2 Jul 10, 2025
35e180a
Fixed versions
F2 Jul 10, 2025
d182852
Updated classwarning to SM 1.12
F2 Jul 10, 2025
831ffd8
Updated fixstvslot to SM 1.12
F2 Jul 10, 2025
b296b70
Use SM 1.12 for compilation
F2 Jul 11, 2025
05dd6a5
Setup/Compile: Make it work better on linux
F2 Jul 11, 2025
cbcfdf5
Upgraded kvizzle unit tests to SM 1.12 + Cleanup of old includes
F2 Jul 11, 2025
0696500
Updated logstf and AnyHttp to SM 1.12
F2 Jul 12, 2025
f4342df
Updated pause to SM 1.12
F2 Jul 13, 2025
8582b44
Updated documentation
F2 Jul 13, 2025
eb57d97
Updated recordstv to SM 1.12
F2 Jul 13, 2025
6875a7e
Use null and delete instead of INVALID_HANDLE and CloseHandle()
F2 Jul 13, 2025
bda9bab
Updated restorescore to SM 1.12 + Use Event instead of Handle
F2 Jul 14, 2025
10f7db5
restorescore: Extra error checking
F2 Jul 14, 2025
8733c87
Update supstats2 to SM 1.12
F2 Jul 14, 2025
941e143
Update waitforstv to SM 1.12
F2 Jul 14, 2025
632ebfd
Roll back new indentation
F2 Jul 14, 2025
34414ea
Bumped medicstats
F2 Jul 14, 2025
796eab1
Use spcomp64
F2 Jul 14, 2025
5cd13d3
Debugging compile.yml
F2 Jul 14, 2025
6cec720
Fixed compilation
F2 Jul 14, 2025
d3fa497
Added quotes for good measure
F2 Jul 14, 2025
22c89c2
Added a test for logstf
F2 Jul 15, 2025
1afc26c
Prefer event.GetX() over GetEventX()
F2 Jul 15, 2025
e5ef5e0
Prefer cv.GetX() over GetConVarX()
F2 Jul 15, 2025
bf620f7
Prefer setters for convars
F2 Jul 15, 2025
72a99fa
fixstvslot: Only change map if no players are no the server
F2 Jul 15, 2025
4fb7423
Removed unnecessary argument
F2 Jul 15, 2025
6e8249f
Validate update.txt files
F2 Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 28 additions & 27 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,38 @@ name: CI

on:
push:
branches:
branches:
- master
paths:
- '**/*.sp'
- '**/*.inc'
- '**/update.txt'
- '**/compile.yml'
- 'prepare-publish.ps1'
paths:
- "**/*.sp"
- "**/*.inc"
- "**/update.txt"
- "**/compile.yml"
- "prepare-publish.ps1"
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SourcePawn Compiler
uses: rumblefrog/setup-sp@v1.0.1
with:
version: '1.10.x'
- name: Prepare publish
run: |
pwsh prepare-publish.ps1
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: ftp-files
# Directory containing files to upload
path: dist/ftp/

- name: Checkout code
uses: actions/checkout@v3
- name: Setup SourcePawn Compiler
uses: rumblefrog/setup-sp@v1.2.4
with:
version: "1.12.x"

- name: Prepare publish
run: |
pwsh prepare-publish.ps1
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: ftp-files
# Directory containing files to upload
path: dist/ftp/

publish:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'F2/F2s-sourcemod-plugins'
needs: build
Expand All @@ -59,13 +60,13 @@ jobs:
const path = require('path');
const baseDir = "ftp";
const data = fs.readFileSync(path.join(baseDir, "f2-sourcemod-plugins.zip"));

const d = new Date();
const dateString =
d.getUTCFullYear() +
("0" + (d.getUTCMonth()+1)).slice(-2) +
("0" + d.getUTCDate()).slice(-2);

const entries = fs.readdirSync(baseDir, { withFileTypes: true });
let body = '| plugin | version |\n';
body += '| -- | -- |\n';
Expand All @@ -86,7 +87,7 @@ jobs:
tag_name: dateString + "-" + d.getTime(),
body: body,
});

github.rest.repos.uploadReleaseAsset({
owner: "F2",
repo: "F2s-sourcemod-plugins",
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ private-*
*.ps1
!setup.ps1
!prepare-publish.ps1
!compile.ps1
!compile.ps1
!keyvalues-parser.ps1
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["sarrus.sourcepawn-vscode"]
}
105 changes: 105 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"editor.formatOnSave": false,
"sourcepawn.formatterSettings": [
"AlignAfterOpenBracket: Align",
"AlignArrayOfStructures: Left",
"AlignConsecutiveAssignments: AcrossEmptyLinesAndComments",
"AlignConsecutiveBitFields: AcrossEmptyLinesAndComments",
"AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments",
"AlignConsecutiveMacros: AcrossEmptyLinesAndComments",
"AlignEscapedNewlines: Left",
"AlignOperands: AlignAfterOperator",
"AlignTrailingComments: true",
"AllowAllArgumentsOnNextLine: true",
"AllowAllConstructorInitializersOnNextLine: true",
"AllowAllParametersOfDeclarationOnNextLine: true",
"AllowShortBlocksOnASingleLine: Always",
"AllowShortCaseLabelsOnASingleLine: true",
"AllowShortEnumsOnASingleLine: true",
"AllowShortFunctionsOnASingleLine: All",
"AllowShortIfStatementsOnASingleLine: AllIfsAndElse",
"AllowShortLambdasOnASingleLine: All",
"AllowShortLoopsOnASingleLine: false",
"AlwaysBreakAfterDefinitionReturnType: None",
"AlwaysBreakAfterReturnType: None",
"AlwaysBreakBeforeMultilineStrings: false",
"AlwaysBreakTemplateDeclarations: No",
"BasedOnStyle: Google",
"BinPackArguments: true",
"BinPackParameters: true",
"BreakBeforeBinaryOperators: NonAssignment",
"BreakBeforeBraces: Custom",
"BraceWrapping: { AfterCaseLabel: true",
"AfterClass: true",
"AfterControlStatement: Never",
"AfterEnum: true",
"AfterExternBlock: true",
"AfterFunction: false",
"AfterNamespace: true",
"AfterObjCDeclaration: false",
"AfterStruct: true",
"AfterUnion: true",
"BeforeCatch: true",
"BeforeElse: false",
"BeforeLambdaBody: true",
"BeforeWhile: true",
"IndentBraces: false",
"SplitEmptyFunction: false",
"SplitEmptyNamespace: false",
"SplitEmptyRecord: false }",
"BreakBeforeConceptDeclarations: false",
"BreakBeforeTernaryOperators: true",
"BreakConstructorInitializers: AfterColon",
"BreakInheritanceList: AfterComma",
"BreakStringLiterals: false",
"ColumnLimit: 0",
"CompactNamespaces: true",
"ConstructorInitializerAllOnOneLineOrOnePerLine: true",
"ConstructorInitializerIndentWidth: ${TabSize}",
"ContinuationIndentWidth: ${TabSize}",
"Cpp11BracedListStyle: false",
"EmptyLineBeforeAccessModifier: LogicalBlock",
"FixNamespaceComments: true",
"IncludeBlocks: Preserve",
"IndentAccessModifiers: false",
"IndentCaseBlocks: false",
"IndentCaseLabels: true",
"IndentExternBlock: Indent",
"IndentGotoLabels: false",
"IndentPPDirectives: BeforeHash",
"IndentRequires: true",
"IndentWidth: ${TabSize}",
"IndentWrappedFunctionNames: true",
"LambdaBodyIndentation: OuterScope",
"Language: Cpp",
"MaxEmptyLinesToKeep: 1",
"NamespaceIndentation: All",
"ObjCBinPackProtocolList: Always",
"ObjCBreakBeforeNestedBlockParam: false",
"ObjCSpaceBeforeProtocolList: false",
"ReflowComments: true",
"SortIncludes: Never",
"SpaceAfterCStyleCast: false",
"SpaceAfterLogicalNot: false",
"SpaceBeforeAssignmentOperators: true",
"SpaceBeforeCaseColon: false",
"SpaceBeforeCpp11BracedList: false",
"SpaceBeforeCtorInitializerColon: true",
"SpaceBeforeInheritanceColon: true",
"SpaceBeforeParens: ControlStatementsExceptControlMacros",
"SpaceBeforeRangeBasedForLoopColon: true",
"SpaceBeforeSquareBrackets: false",
"SpaceInEmptyBlock: false",
"SpaceInEmptyParentheses: false",
"SpacesBeforeTrailingComments: 1",
"SpacesInConditionalStatement: false",
"SpacesInContainerLiterals: true",
"SpacesInCStyleCastParentheses: false",
"SpacesInParentheses: false",
"SpacesInSquareBrackets: false",
"Standard: Auto",
"TabWidth: ${TabSize}",
"UseTab: ForContinuationAndIndentation",
"CommentPragmas: '^#define|#tryinclude'"
]
}
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ F2's SourceMod plugins for competitive Team Fortress 2.

Download all plugins in a zip file here: <a href="https://sourcemod.krus.dk/f2-sourcemod-plugins.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>

### Medic Stats <a href="https://sourcemod.krus.dk/medicstats.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>
### Medic Stats <a href="https://sourcemod.krus.dk/medicstats.zip"><img src="https://img.shields.io/badge/-download-informational" /></a> <a href="./medicstats"><img src="https://img.shields.io/badge/-More%20info-yellowgreen" /></a>

- Logs buff heals (~95% accurate)
- Logs average time to build über
Expand All @@ -16,7 +16,7 @@ Download all plugins in a zip file here: <a href="https://sourcemod.krus.dk/f2-s
- Logs other additional medic stats
- See [example on logs.tf](https://logs.tf/154545)

### Supplemental Stats 2 <a href="https://sourcemod.krus.dk/supstats2.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>
### Supplemental Stats 2 <a href="https://sourcemod.krus.dk/supstats2.zip"><img src="https://img.shields.io/badge/-download-informational" /></a> <a href="./supstats2"><img src="https://img.shields.io/badge/-More%20info-yellowgreen" /></a>

- Logs damage and real damage per weapon
- Logs damage taken
Expand Down Expand Up @@ -53,35 +53,36 @@ Download all plugins in a zip file here: <a href="https://sourcemod.krus.dk/f2-s
- Option to restore player positions when unpausing
- Option to restore cloak meters when unpausing

### ClassWarning <a href="https://sourcemod.krus.dk/classwarning.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>
### ClassWarning <a href="https://sourcemod.krus.dk/classwarning.zip"><img src="https://img.shields.io/badge/-download-informational" /></a> <a href="./classwarning"><img src="https://img.shields.io/badge/-More%20info-yellowgreen" /></a>

- In ETF2L, class limits are not enforced by the server. This plugin warns players in chat if they are breaking the class limit (see [screenshot](https://sourcemod.krus.dk/classwarning.jpg)).

### RecordSTV <a href="https://sourcemod.krus.dk/recordstv.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>
### RecordSTV <a href="https://sourcemod.krus.dk/recordstv.zip"><img src="https://img.shields.io/badge/-download-informational" /></a> <a href="./recordstv"><img src="https://img.shields.io/badge/-More%20info-yellowgreen" /></a>

- When a match starts, it starts recording a STV demo
- When the match ends, it stops the recording
- Set up the path and the filenames of the demos with cvars: **recordstv_path** and **recordstv_filename**
- In both cvars you can use several placeholders. See the description of recordstv_filename for the full list of placeholders.

### WaitForSTV <a href="https://sourcemod.krus.dk/waitforstv.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>
### WaitForSTV <a href="https://sourcemod.krus.dk/waitforstv.zip"><img src="https://img.shields.io/badge/-download-informational" /></a> <a href="./waitforstv"><img src="https://img.shields.io/badge/-More%20info-yellowgreen" /></a>

- Waits up to 90 seconds when changing map
- Doesn't wait more time than necessary

### AFK <a href="https://sourcemod.krus.dk/afk.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>
### AFK <a href="https://sourcemod.krus.dk/afk.zip"><img src="https://img.shields.io/badge/-download-informational" /></a> <a href="./afk"><img src="https://img.shields.io/badge/-More%20info-yellowgreen" /></a>

- If a player is AFK in warmup, it shows [a warning](https://sourcemod.krus.dk/afk-1.jpg) to all players on their team
- If both teams ready up and there is an AFK player, it shows [a warning](https://sourcemod.krus.dk/afk-2.jpg) to the person's team
- Works together with TF2DM... if a player is AFK, they will be moved back to spawn

### RestoreScore <a href="https://sourcemod.krus.dk/restorescore.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>

- Restores a player's score on the scoreboard when he reconnects
- Restores a player's score on the scoreboard when they reconnect

### FixStvSlot <a href="https://sourcemod.krus.dk/fixstvslot.zip"><img src="https://img.shields.io/badge/-download-informational" /></a>

- Changes the map on server start to avoid a crash related to STV slot
- Automatically changes the level when STV is enabled, allowing the bot to join.

## Automatic updates

Expand All @@ -94,6 +95,7 @@ For building a plugin locally, run these commands in Powershell 6+:
```powershell
git clone https://github.com/F2/F2s-sourcemod-plugins.git
cd F2s-sourcemod-plugins
pwsh # Start powershell if you are not already in a powershell terminal
./setup.ps1

compile logstf
Expand Down
8 changes: 4 additions & 4 deletions afk/afk.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public SharedPlugin:__pl_afk =
public SharedPlugin __pl_afk =
{
name = "afk",
file = "afk.smx",
Expand All @@ -10,12 +10,12 @@ public SharedPlugin:__pl_afk =
};

#if !defined REQUIRE_PLUGIN
public __pl_afk_SetNTVOptional()
public void __pl_afk_SetNTVOptional()
{
MarkNativeAsOptional("IsPlayerAFK");
}
#endif

native bool:IsPlayerAFK(client);
native bool IsPlayerAFK(int client);

forward OnAfkStateChanged(client, bool:afk);
forward void OnAfkStateChanged(int client, bool afk);
Loading