Skip to content

Commit

Permalink
Merge pull request #1 from Hedgefog/master
Browse files Browse the repository at this point in the history
add version and game description
  • Loading branch information
Hedgefog committed May 9, 2022
2 parents 2e9b2b0 + 9b98f7e commit b0b770f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### ❄ Snow Wars mod for Counter-Strike 1.6
__Version:__ 0.9.0 (Alpha)
__Version:__ 0.9.1 (Alpha)

### 📄 About

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snowwars",
"version": "0.9.0",
"version": "0.9.1",
"author": "Hedgehog Fog",
"description": "Snow Wars Mod",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/include/snowwars_const.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define SW_TITLE "Snow Wars"
#define SW_VERSION "0.9.0"
#define SW_VERSION "0.9.1"
20 changes: 20 additions & 0 deletions src/scripts/core/snowwars.sma
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
#pragma semicolon 1

#include <amxmodx>
#include <fakemeta>
#include <snowwars>

#define PLUGIN "Snow Wars"
#define VERSION SW_VERSION
#define AUTHOR "Hedgehog Fog"

new g_pCvarVersion;

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);

register_forward(FM_GetGameDescription, "OnGetGameDescription");

g_pCvarVersion = register_cvar("snowwars_version", VERSION, FCVAR_SERVER);
hook_cvar_change(g_pCvarVersion, "OnVersionCvarChange");
}

public plugin_natives() {
register_library("snowwars");
}

public OnVersionCvarChange() {
set_pcvar_string(g_pCvarVersion, SW_VERSION);
}

public OnGetGameDescription() {
static szGameName[32];
format(szGameName, charsmax(szGameName), "%s %s", SW_TITLE, SW_VERSION);
forward_return(FMV_STRING, szGameName);

return FMRES_SUPERCEDE;
}

0 comments on commit b0b770f

Please sign in to comment.