Skip to content

Commit

Permalink
get sm_server_tier to mapchooser & updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
qawery-just-sad committed Jun 3, 2020
1 parent 99e5a6e commit fa5db1f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,28 @@

## About

This is a edit of the default SourceMod mapchooser and nomination plugin, it provides functionality for any ckSurf based timer to display tiers of maps in the nominate and vote menus
This is a edit of the default SourceMod mapchooser and nomination plugin, it provides functionality for Fluffys SurfTimer or it's forks to display tiers of maps in the nominate and vote menus.

## Requirements

* Sourcemod 1.8
* MySQL
* Sourcemod 1.8+
* MySQL 5.7 / 8+ / MariaDB supported
* SurfTimer from [Olokos](https://github.com/surftimer/Surftimer-olokos) or [Fluffys](https://github.com/fluffyst/Surftimer)(NO LONGER MAINTAINED!)

## Installation

* Upload all the files to your csgo server directory
* Add a MySQL database called `surftimer` to `csgo/addons/sourcemod/configs/databases.cfg` (Note: must match the database you're using for SurfTimer`)
* Set `sm_cksurf_type` in `cfg/nominations.cfg` (0 if using original/nikos/marcos ckSurf, 1 if using fluffys/z4lab's SurfTimer)
* Set `sm_server_tier` in `cfg/nominations.cfg` to the tier of maps you want appearing the nominate list. Example, for a tier 1-3 server, set it to `sm_server_tier 1.3`, a tier 1 only server would be `sm_server_tier 1.0`
* Get latest plugin files from [Realase Page](https://github.com/qawery-just-sad/surftimer-mapchooser/releases)
* Copy files over to `csgo/addons/sourcemod`
* Make sure that `csgo/addons/sourcemod/configs/databases.cfg` points to the surftimer database (You have to use the same database as the SurfTimer)
```
"surftimer"
{
"driver" "mysql"
"host" "localhost" // The ip address to the database server
"database" "surftimerdb" // The database name that surftimer uses
"user" "dbuser" // The user name that has access to that database
"pass" "dbuserpassword" // The password for user specified above
"port" "3306" // The port to the database server
}
```
* Set `sm_server_tier` in `csgo/cfg/mapchooser.cfg` to the tier of maps you want appearing the nominate list. Example, for a tier 1-3 server, set it to `sm_server_tier 1.3`, a tier 1 only server would be `sm_server_tier 1.0`
4 changes: 3 additions & 1 deletion addons/sourcemod/scripting/mapchooser.sp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public void OnPluginStart()
g_Cvar_RunOff = CreateConVar("sm_mapvote_runoff", "0", "Hold run of votes if winning choice is less than a certain margin", _, true, 0.0, true, 1.0);
g_Cvar_RunOffPercent = CreateConVar("sm_mapvote_runoffpercent", "50", "If winning choice has less than this percent of votes, hold a runoff", _, true, 0.0, true, 100.0);

// KP Surf ConVars
g_Cvar_ServerTier = CreateConVar("sm_server_tier", "1.0", "Specifies the tier range for maps, for example if you want a tier 1-3 server make it 1.3, a tier 2 only server would be 2.0, etc", 0, true, 1.0, true, 8.0);

RegAdminCmd("sm_mapvote", Command_Mapvote, ADMFLAG_CHANGEMAP, "sm_mapvote - Forces MapChooser to attempt to run a map vote now.");
RegAdminCmd("sm_setnextmap", Command_SetNextmap, ADMFLAG_CHANGEMAP, "sm_setnextmap <map>");

Expand Down Expand Up @@ -1245,7 +1248,6 @@ public void SelectMapList()
{
char szQuery[256], szTier[16], szBuffer[2][32];

g_Cvar_ServerTier = FindConVar("sm_server_tier");
GetConVarString(g_Cvar_ServerTier, szTier, sizeof(szTier));
ExplodeString(szTier, ".", szBuffer, 2, 32);

Expand Down
5 changes: 2 additions & 3 deletions addons/sourcemod/scripting/nominations.sp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ public void OnPluginStart()
g_Cvar_ExcludeOld = CreateConVar("sm_nominate_excludeold", "1", "Specifies if the MapChooser excluded maps should also be excluded from Nominations", 0, true, 0.00, true, 1.0);
g_Cvar_ExcludeCurrent = CreateConVar("sm_nominate_excludecurrent", "1", "Specifies if the current map should be excluded from the Nominations list", 0, true, 0.00, true, 1.0);

// KP Surf ConVars
g_Cvar_ServerTier = CreateConVar("sm_server_tier", "1.0", "Specifies the servers tier to only include maps from, for example if you want a tier 1-3 server make it 1.3, a tier 2 only server would be 2.0, etc", 0, true, 1.0, true, 8.0);

RegConsoleCmd("sm_nominate", Command_Nominate);

Expand Down Expand Up @@ -460,7 +458,8 @@ public void db_setupDatabase()
public void SelectMapList()
{
char szQuery[256], szTier[16], szBuffer[2][32];


g_Cvar_ServerTier = FindConVar("sm_server_tier");
GetConVarString(g_Cvar_ServerTier, szTier, sizeof(szTier));
ExplodeString(szTier, ".", szBuffer, 2, 32);

Expand Down

0 comments on commit fa5db1f

Please sign in to comment.