~exe file removed, potential virus~
You can make that when entering a cast, modify the table castViewers, and by the same way that when leaving that cast, modify the castViewers table again, for example:
Code:
db.query("UPDATE `players` SET `castViewers` = 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
or something similar...