You could try calling this function on each of the Arena Frames. This is called when you adjust the CVAR variable
Lua Code:
function ArenaEnemyFrames_Disable(self)
self.show = false;
ArenaEnemyFrames_UpdateVisible();
end
This is the function that calls it in Blizzards addon.
Lua Code:
function ArenaEnemyFrames_CheckEffectiveEnableState(self, cvarUpdate)
if (C_PvP.IsInBrawl()) then
ArenaEnemyFrames_Disable(self);
else
if ( GetCVarBool("showArenaEnemyFrames") or cvarUpdate ) then
ArenaEnemyFrames_Enable(self);
else
ArenaEnemyFrames_Disable(self);
end
end
end
Which is called by the Event Manager function
Lua Code:
if ( (event == "CVAR_UPDATE") and (arg1 == "SHOW_ARENA_ENEMY_FRAMES_TEXT") ) then
ArenaEnemyFrames_CheckEffectiveEnableState(self, arg2 == "1");
Your code should work I believe but you will need to have an frame to monitor the event ADDON_LOADED so that once you Load Blizzards addon it will trigger the event and its information should be available to use and adjust. I thought the SetCVar would trigger the CVAR_UPDATE event but it is looking for a different CVAR value to what you are setting which could explain why it isn't doing anything noticable. Maybe changing
SetCVar("showArenaEnemyFrames", 0)
to
SetCVar("SHOW_ARENA_ENEMY_FRAMES_TEXT", 0)
and see how that works, then try the ADDON_LOADED steps I suggested.