Good afternoon WibbenZ.
I'm having the same problem as rodias, and tried to solve it with a lot of researches and have already tried creating a script(you can see it below).
Code:
function onThink(cid, interval, lastExecution)
local count = 0
local p = getPlayersOnline(cid)
for k,d in pairs(p) do
if getPlayerCast(cid).status == true then
local t = getCastViewers(cid)
for _,v in pairs(t) do
count = count + 1
end
db.query("UPDATE `players` SET `castViewers` = '"..count.."' WHERE `id` = " .. getPlayerGUID(cid))
end
end
return true
end
I tried to use doPlayerSetCastState(cid, true), getPlayerCast(cid) instead of getPlayerCast(cid).status == true and none of them worked.
Firstly, I the /cast talkaction was wrong, it wasn't updating the database, setting cast = 1 and the castDescription. I think the source was supposed to update the db, but it isn't, so I've just added a query in the cast.lua to update it.
Now the viewers are not being updated, the source isn't doing what it was supposed to, and none script could not help me.
You can look my sources(tfs 0.4 rev 3777) in the attached files.
I know that you are not able to help us everytime, and you have your own things to do, but I really need it asap :/
thanks