Solved Cancel OnPlayerSleepEnded?

Discussion in 'Rust Development' started by Xephiro, May 4, 2015.

  1. I'm trying with the next code in lua

    Code:
    function PLUGIN:OnPlayerSleepEnded(player)
           print("TEST")
           return false
    end
    The text is printing, but the player can stand up any time.

    Is possible hold sleeping a player?

    Sorry for my english :D
     
  2. Wulf

    Wulf Community Admin

    There is no return behavior, so no way to cancel it. All you could do is put them back to sleep.
     
  3. Code:
    function PLUGIN:OnPlayerSleepEnded(player)
           print("TEST")
           player:StartSleeping()
    end
    might work, dunno
     
  4. Sorry, but the player stand up without problem.

    Exist any other Function called after OnPlayerSleepEnded?
     
  5. probably needs to put a fimer then
    timer.Once(0.1, function() player:StartSleeping() end, self.Plugin)
    don't remember