1. Hi guys,

    So I saw the the recent post about the StartSleeping function in LUA so I decided to test it out in C#.

    I've basically done what was in the LUA:

    Code:
    [ChatCommand("afkc")]
    void cmdAfk(BasePlayer player, string command, string[] args)
            {
                player.StartSleeping();
    }
    The only thing I'd like to do is 'detect' when the player is asleep or awake.

    I've made a little bit in there already but I know that it's not right, I'm just wondering if there is a function or something for it. And is there a website URL like http://docs.oxidemod.org/?lua#getting-started for all the things like player.StartSleeping() and player.(whatever) that shows all of them?

    Thanks in advance!

    This is what I've done, where the player.StartSleeping == true or false is where I'm wondering if there is something like player.IsSleeping().

    Code:
    [ChatCommand("afkc")]
            void cmdAfk(BasePlayer player, string command, string[] args)
            {
                player.StartSleeping();           
                if(player.StartSleeping() == true)
                {
                    void sleepingMessageT(BasePlayer player)
                    {
                        var messageT = string.Format(player.displayName + " is now sleeping/afk");
                        rust.BroadcastChat({ messageT });
                    }
                    sleepingMessageT();            } else if(player.StartSleeping() == false)
                {
                    void sleepingMessageF(BasePlayer player)
                    {
                        var messageF = string.Format(player.displayName + " is now back from being afk/asleep");
                        rust.BroadcastChat({ messageF });
                    }
                    sleepingMessageF();
                }
            }
     
  2. Yes, IsSleeping() exists.

    [​IMG]
     
  3. Okay,

    Sorry.. :p Someone can delete this post like Wulf,

    but is there a website like that link I gave up there ^ that has ALL the 'commands' for the Oxide API in Csharp?
    [DOUBLEPOST=1427680276][/DOUBLEPOST]By the way, when I use rust.BroadcastChat({ message }); it has problems compiling, anything else that can do what BroadcastChat does?

    I know that PrintToChat works instead of SendChatMessage.