Skip to content

Commit fa5db1f

Browse files
get sm_server_tier to mapchooser & updated readme
1 parent 99e5a6e commit fa5db1f

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,28 @@
22

33
## About
44

5-
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
5+
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.
66

77
## Requirements
88

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

1213
## Installation
1314

14-
* Upload all the files to your csgo server directory
15-
* Add a MySQL database called `surftimer` to `csgo/addons/sourcemod/configs/databases.cfg` (Note: must match the database you're using for SurfTimer`)
16-
* Set `sm_cksurf_type` in `cfg/nominations.cfg` (0 if using original/nikos/marcos ckSurf, 1 if using fluffys/z4lab's SurfTimer)
17-
* 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`
15+
* Get latest plugin files from [Realase Page](https://github.com/qawery-just-sad/surftimer-mapchooser/releases)
16+
* Copy files over to `csgo/addons/sourcemod`
17+
* Make sure that `csgo/addons/sourcemod/configs/databases.cfg` points to the surftimer database (You have to use the same database as the SurfTimer)
18+
```
19+
"surftimer"
20+
{
21+
"driver" "mysql"
22+
"host" "localhost" // The ip address to the database server
23+
"database" "surftimerdb" // The database name that surftimer uses
24+
"user" "dbuser" // The user name that has access to that database
25+
"pass" "dbuserpassword" // The password for user specified above
26+
"port" "3306" // The port to the database server
27+
}
28+
```
29+
* 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`

addons/sourcemod/scripting/mapchooser.sp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ public void OnPluginStart()
146146
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);
147147
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);
148148

149+
// KP Surf ConVars
150+
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);
151+
149152
RegAdminCmd("sm_mapvote", Command_Mapvote, ADMFLAG_CHANGEMAP, "sm_mapvote - Forces MapChooser to attempt to run a map vote now.");
150153
RegAdminCmd("sm_setnextmap", Command_SetNextmap, ADMFLAG_CHANGEMAP, "sm_setnextmap <map>");
151154

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

1248-
g_Cvar_ServerTier = FindConVar("sm_server_tier");
12491251
GetConVarString(g_Cvar_ServerTier, szTier, sizeof(szTier));
12501252
ExplodeString(szTier, ".", szBuffer, 2, 32);
12511253

addons/sourcemod/scripting/nominations.sp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ public void OnPluginStart()
8181
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);
8282
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);
8383

84-
// KP Surf ConVars
85-
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);
8684

8785
RegConsoleCmd("sm_nominate", Command_Nominate);
8886

@@ -460,7 +458,8 @@ public void db_setupDatabase()
460458
public void SelectMapList()
461459
{
462460
char szQuery[256], szTier[16], szBuffer[2][32];
463-
461+
462+
g_Cvar_ServerTier = FindConVar("sm_server_tier");
464463
GetConVarString(g_Cvar_ServerTier, szTier, sizeof(szTier));
465464
ExplodeString(szTier, ".", szBuffer, 2, 32);
466465

0 commit comments

Comments
 (0)