Lua
function AFK_System_func()
local x, y, z = getElementPosition ( lp )
local dist = getDistanceBetweenPoints2D ( oldAFKXPos, oldAFKYPos, x, y )
if getElementData ( lp, "loggedin" ) then
if not action and getElementData ( lp, "jailtime" ) <= 0 then
if afkRun == 15 and not getElementData ( lp, "AFK" ) == 0 then
outputChatBox ( "Du wurdest AFK gesetzt", 0, 125, 0 )
setElementData ( lp, "AFK", 1 )
action = true
oldAFKXPos = x
oldAFKYPos = y
else
afkRun = afkRun + 1
action = false
end
else
if dist > 5 and getElementData ( lp, "AFK" ) == 1 or getElementHealth ( lp ) <= 1 or isElement ( gImage["Back"] ) or guiGetVisible ( gWindow["pokerOwnCards"] ) then
outputChatBox ( "Willkommen zurück", 125, 0, 0 )
setElementData ( lp, "AFK", 0 )
action = false
afkRun = 0
end
end
end
end
setTimer ( AFK_System_func, 4000, -1 )
Alles anzeigen
Kann mir einer Sagen, warum man nach 1 Minute nicht AFK gesetzt wird?
Die Zeit ist nur zum Test um herauszufinden, ob die Funktion funktioniert.
Danke im Voraus