Skilled Illusionist
- Joined
- Jul 30, 2008
- Messages
- 340
- Reaction score
- 50
Hello It's my! I'm posting the !afk script.
First put this into the talkactions.XML(On the player's)
<talkaction words="!afk" event="script" value="afk.lua"/>
then go to Talkactions>>>>>>>>Scripts and save this script in it whith the name afk.lua
--[[
<Afk> for TFS 0.2+
Script Scripted by DonSzeh
]]--
local time = 5 -- 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),"afk", 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 == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
if param == "on" then
if isPlayer(cid) == TRUE then
doSendAnimatedText(getPlayerPosition(cid),"afk", math.random(01,255))
end
say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Bye!
elseif param == "off" then
stopEvent(say_events[getPlayerGUID(cid)])
say_events[getPlayerGUID(cid)] = nil
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Welcome back!.")
end
return TRUE
end
I hope this will helped you!
Please leave a comment;p
First put this into the talkactions.XML(On the player's)
<talkaction words="!afk" event="script" value="afk.lua"/>
then go to Talkactions>>>>>>>>Scripts and save this script in it whith the name afk.lua
--[[
<Afk> for TFS 0.2+
Script Scripted by DonSzeh
]]--
local time = 5 -- 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),"afk", 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 == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
if param == "on" then
if isPlayer(cid) == TRUE then
doSendAnimatedText(getPlayerPosition(cid),"afk", math.random(01,255))
end
say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Bye!
elseif param == "off" then
stopEvent(say_events[getPlayerGUID(cid)])
say_events[getPlayerGUID(cid)] = nil
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Welcome back!.")
end
return TRUE
end
I hope this will helped you!
Please leave a comment;p
Last edited: