jareczekjsp
Member
Hello guys i wouldlike if player have a cast on Everybody see on site ,I have Page ,query but have a problem with globalevents
[0:18:47] [Error - GlobalEvent Interface]
[0:18:47] data/globalevents/scripts/cast.luanThink
[0:18:47] Description:
[0:18:47] data/globalevents/scripts/cast.lua:4: attempt to call global 'getPlayerSpectators' (a nil value)
[0:18:47] stack traceback:
[0:18:47] data/globalevents/scripts/cast.lua:4: in function <data/globalevents/scripts/cast.lua:1>
[0:18:47] [Error - GlobalEvents::think] Couldn't execute event: cast
Myscript is:
[0:18:47] [Error - GlobalEvent Interface]
[0:18:47] data/globalevents/scripts/cast.luanThink
[0:18:47] Description:
[0:18:47] data/globalevents/scripts/cast.lua:4: attempt to call global 'getPlayerSpectators' (a nil value)
[0:18:47] stack traceback:
[0:18:47] data/globalevents/scripts/cast.lua:4: in function <data/globalevents/scripts/cast.lua:1>
[0:18:47] [Error - GlobalEvents::think] Couldn't execute event: cast
Myscript is:
Somebody help me ?Please I use Tfs 0.4function onThink(interval)
local players = getPlayersOnline()
for _, pid in ipairs(players) do
local data = getPlayerSpectators(pid)
if(data.broadcast) then
db.query("UPDATEplayers
setviewers
= " .. table.maxn(data.names) .. " whereid
= " .. getPlayerGUID(pid) .. ";")
end
end
return true
end