local time = 3 -- 1 = 1 sec, 2 = 2 sec, ...
local say_events = {}
local function SayText(cid)
if isPlayer(cid) == TRUE then
if say_events[getPlayerGUID(cid)] ~= nil then
if isPlayer(cid) == TRUE then
doSendAnimatedText(getPlayerPosition(cid),"I'm AFK!", math.random(01,255))
end
say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)
end
end
return TRUE
end
function onThink(cid)
if (getPlayerIdleTime(cid) > 3 * 1000 * 60) then
doSendAnimatedText(getCreaturePosition(cid), "I'm AFK!", math.random(01,255))
say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
end
return true
end