ULX

Author Topic: AAFK for gmod  (Read 1793 times)

0 Members and 1 Guest are viewing this topic.

Offline S

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
AAFK for gmod
« on: June 27, 2014, 04:24:20 PM »
I'm trying to get the AAFK script to put players in spec once they are tagged as AFK. The only options in the default script are to tag and kick the player. I tried adding this inside the script:

Code: [Select]
function GM:PlayerSpawn( ply )
if pl.afk == true then
  GAMEMODE:PlayerSpawnAsSpectator( ply )
end

It's not working, so I'm probably way off right? What would be the best way of going about this? Thanks in advance for any advice.

Offline Fanney

  • Newbie
  • *
  • Posts: 44
  • Karma: 11
Re: AAFK for gmod
« Reply #1 on: June 27, 2014, 04:39:07 PM »
What gamemode are you using?
Some gamemodes have an custom spectator system, that means you need to call the gamemodes function.

/E: As you see you call it under "PlayerSpawn", that means it only get's executed if he spawns and therefore he isn't marked as afk (if im right, i am not familar with how aafk works) .