Jump to content

Error or AFK


Recommended Posts

when I type the command / back I did not go back to the AFK and says I'm not AFK "

  
function PosTime(source) 
local pos1 = getElementPosition(source) 
if (pos == pos1) then 
outputChatBox ( "You are AFK use /back to exit AFK mode", source, 0, 255, 0) 
setElementFrozen (source, true) 
setElementDimension (source, -- s8) -->
setElementData(source, "", 1) 
else 
outputChatBox ( "You moved", source, 255, 0, 0) 
end 
end 
function afkGo(source) 
pos = getElementPosition(source) 
outputChatBox ( "Wait 5 seconds without moving", source, 0, 255, 0) 
setTimer(PosTime,5000,1,source) 
end 
addCommandHandler('afk', afkGo) 
  
function afkExit(source) 
local away = getElementData(source, "back") 
if (away == 0) then 
outputChatBox ( "", source, 0, 255, 0) 
    if isElementFrozen ( source ) and getElementData(player,"back")  then 
        setElementFrozen ( source, false ) 
        setElementDimension (source,0) 
        setElementData (source,"back",0) 
else 
outputChatBox ( "Dont AFK", source, 0, 255, 0) 
end 
end 
end 
end 
  
addCommandHandler('back', afkExit) 
  
function awayList(source) 
local connectedPlayers = getElementsByType ( "player" ) 
for i, aPlayer in ipairs(connectedPlayers) do 
local afk = getElementData(aPlayer, "afk")  if (afk == 1) then 
outputChatBox ( "tst", source) 
   end 
end 
end 
  
addCommandHandler('dbug1', awayList)     
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...