Jump to content

[help] trying to detect if a player is afk


Raizel

Recommended Posts

Posted

hello! I'm trying to detect if a player is afk and if he is afk then put him in a animation

client:

function isLocalPlayerActive ()
    if isMainMenuActive() then
       setElementData(getLocalPlayer(),"status","afk", true)
       triggerServerEvent("afk", source)
    else
       setElementData(getLocalPlayer(),"status","playing", true)
       triggerServerEvent("notafk", source)
    end
 end

server:

addEvent('afk', true)
addEventHandler('afk', root, function()
    setPedAnimation(source, "BEACH", "Lay_Bac_Loop", -1, true, false, false )
end)

addEvent('notafk', true)
addEventHandler('notafk', root, function()
    setPedAnimation(source)
end)

 

it doesn't do anything and the debugscript says nothing so idk what to do..

  • 3 weeks later...

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...