Plugin A:
Code:
public void OnPluginStart()
{
Handle cvar = FindConVar("sm_stoprecord");
if (cvar == INVALID_HANDLE) cvar = CreateConVar("sm_stoprecord", "0", "Description", _, true, 0.0, true, 1.0);
CloseHandle(cvar);
}
public void OnMapEnd()
{
Handle cvar = FindConVar("sm_stoprecord");
if (cvar != INVALID_HANDLE) SetConVarInt(cvar,1,false,false);
CloseHandle(cvar);
}
Plugin B:
Code:
public void OnAllPluginsLoaded()
{
Handle cvar = FindConVar("sm_stoprecord");
if (cvar != INVALID_HANDLE) HookConVarChange(cvar,StopRecordChanged);
CloseHandle(cvar);
}
public void StopRecordChanged(Handle convar, const char[] oldValue, const char[] newValue)
{
if (StringToInt(newValue) == 1)
{
//stuff
}
else
{
//stuff
}
}
You could also set the CVar in plugin A to be a global handle, but it isn't really necessary.