mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 12:13:20 +00:00
Add check for max players cvar
This commit is contained in:
parent
71889d6788
commit
5b490def66
2 changed files with 6 additions and 5 deletions
Binary file not shown.
|
@ -100,9 +100,11 @@ public void OnPluginStart() {
|
|||
hForceSurvivorSet = FindConVar("l4d_force_survivorset");
|
||||
|
||||
hSVMaxPlayers = FindConVar("sv_maxplayers");
|
||||
hPlayerLimit = CreateConVar("sm_player_limit", "0", "Overrides sv_maxplayers. 0 = off, > 0: limit", FCVAR_NONE, true, 0.0, false);
|
||||
hPlayerLimit.AddChangeHook(Event_PlayerLimitChange);
|
||||
hSVMaxPlayers.IntValue = hPlayerLimit.IntValue;
|
||||
if(hSVMaxPlayers != null) {
|
||||
hPlayerLimit = CreateConVar("sm_player_limit", "0", "Overrides sv_maxplayers. 0 = off, > 0: limit", FCVAR_NONE, true, 0.0, false);
|
||||
hPlayerLimit.AddChangeHook(Event_PlayerLimitChange);
|
||||
hSVMaxPlayers.IntValue = hPlayerLimit.IntValue;
|
||||
}
|
||||
|
||||
|
||||
hFFNotice.AddChangeHook(CVC_FFNotice);
|
||||
|
@ -675,8 +677,7 @@ public void OnMapStart() {
|
|||
}
|
||||
public void OnConfigsExecuted() {
|
||||
isL4D1Survivors = L4D2_GetSurvivorSetMap() == 1;
|
||||
|
||||
if(hPlayerLimit.IntValue > 0) {
|
||||
if(hSVMaxPlayers != null && hPlayerLimit.IntValue > 0) {
|
||||
hSVMaxPlayers.IntValue = hPlayerLimit.IntValue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue