Skip to content

Commit

Permalink
Do not allow admins to change cvars with FCVAR_SPONLY flag when not i…
Browse files Browse the repository at this point in the history
…n singleplayer via amx_cvar

1. Make amx_cvar command obey FCVAR_SPONLY flag.
2. Fix exploiting of amx_nextmap cvar value which is used in nextmap plugin.
  • Loading branch information
etojuice committed Jan 8, 2020
1 parent ac33e8a commit adbc3e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/admincmd.sma
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,12 @@ public cmdCvar(id, level, cid)
return PLUGIN_HANDLED
}

if ((get_pcvar_flags(pointer) & FCVAR_SPONLY) && MaxClients != 1)
{
console_print(id, "[AMXX] %L", id, "CVAR_NO_ACC")
return PLUGIN_HANDLED
}

if (equali(arg, "servercfgfile") || equali(arg, "lservercfgfile") || equali(arg, "mapchangecfgfile"))
{
new pos = contain(arg2, ";")
Expand Down

0 comments on commit adbc3e0

Please sign in to comment.