Doggynub
LUA / C++
- Joined
- Sep 28, 2008
- Messages
- 2,541
- Reaction score
- 186
Hope you will like it.
How it works:
1-!afk on (it make animation <afk> on you ,you can edit the time between ea animation,it make you moveless)
2-!afk off (you set animation to off,you able to move again)
Put this in talkaction.xml
Then go to talkacion-->script make file called afk.lua and paste that in it:
Just edit the time beside <local time> it is in sceonds
For who wanted a pic:
!afk -->on
!afk --> off
ps:don't make this while training
How it works:
1-!afk on (it make animation <afk> on you ,you can edit the time between ea animation,it make you moveless)
2-!afk off (you set animation to off,you able to move again)
Put this in talkaction.xml
Code:
<talkaction words="!afk" event="script" value="afk.lua"/>
Lua:
--[[
<Afk> for TFS 0.2+
Idea by Damadgerz
based on shawak's script , changez by damadgerz
Fixed by the Sync
]]--
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) and (getPlayerStorageValue(cid, 9876) == -1) then
doSendAnimatedText(getPlayerPosition(cid),"afk", math.random(01,255))
say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
doPlayerSetNoMove(cid, TRUE)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"You Now Stated you are (afk).")
setPlayerStorageValue(cid, 9876, 5)
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"You have already stated that you are AFK.")
end
elseif param == "off" then
stopEvent(say_events[getPlayerGUID(cid)])
say_events[getPlayerGUID(cid)] = nil
doPlayerSetNoMove(cid, FALSE)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"You Now stated your are not (afk).")
setPlayerStorageValue(cid, 9876, -1)
end
return TRUE
end
Just edit the time beside <local time> it is in sceonds
For who wanted a pic:
!afk -->on
!afk --> off
ps:don't make this while training
Last edited: