Code:
#include <amxmisc>
#if AMXX_VERSION_NUM < 183
#assert AMX Mod X v1.8.3 or later library required!
#endif
new cvarhook:rconhandle;
public plugin_init()
{
register_plugin
(
.plugin_name = "Block changing rcon_password",
.version = "1.0",
.author = "lüxor"
);
rconhandle = hook_cvar_change(get_cvar_pointer("rcon_password"), "setDefaultValue");
}
public setDefaultValue(PointerCvar, const OldValue[], const NewValue[])
{
if(!equal(NewValue, OldValue))
{
disable_cvar_hook(rconhandle);
set_pcvar_string(PointerCvar, OldValue);
enable_cvar_hook(rconhandle);
}
}