--[[
Talking Tp/signs/tiles for TFS 0.2
By 40% by Marki, 60% by Shawak
]]--
local time = 2 -- 1 = 1 sec, 2 = 2 sec, ...
local config = {
--X pos,Y pos, Z pos, text
[1] = {pos = {132,93,7}, text = {"Work"}},
[2] = {pos = {133,93,7}, text = {"Yeah!"}}
}
local say_events = {}
local function SayText(cid)
if isPlayer(cid) == TRUE then
if say_events[getPlayerGUID(cid)] ~= nil then
for _, area in pairs(config) do
doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01,255))
end
say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)
end
end
return TRUE
end
function onSay(cid, words, param, channel)
if param == "on" then
for _, area in pairs(config) do
doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01,255))
end
say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
doPlayerSendTextMessage(cid,19,"You set the function \"SayText\" -> ON.")
elseif param == "off" then
stopEvent(say_events[getPlayerGUID(cid)])
say_events[getPlayerGUID(cid)] = nil
doPlayerSendTextMessage(cid,19,"You set the function \"SayText\" -> OFF.")
end
return TRUE
end