• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction A little funny <afk> script

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
Code:
<talkaction words="!afk" event="script" value="afk.lua"/>
Then go to talkacion-->script make file called afk.lua and paste that in it:
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
345kftu.jpg



!afk --> off
2na8kye.jpg







ps:don't make this while training :)
 
Last edited:
Code:
function onThink(cid, interval)
	if (getPlayerIdleTime(cid) > 5 * 1000 * 60) then
		doSendAnimatedText(getCreaturePosition(cid), "AFK!", TEXTCOLOR_WHITE)
	end
	return true
end

Xd?
 
Code:
function onThink(cid, interval)
	if (getPlayerIdleTime(cid) > 5 * 1000 * 60) then
		doSendAnimatedText(getCreaturePosition(cid), "AFK!", TEXTCOLOR_WHITE)
	end
	return true
end

Xd?

...:eek:
 
Could u make it so when you are moving it goes off? and if you havn't been moving for more then X minutes it goes on?

Would be awsome if so!
 
--[[
Talking Tp/signs/tiles for TFS 0.2+
89%shawak,11%Damadgerz
Idea by Damadgerz
]]--

Hey idiot, how do you calculate these percentages? ¬¬
 
Back
Top