1. Oxide 1.18 has been discontinued and is no longer supported. Please do not post requests for Oxide 1.18 plugins or support.
    We recommend upgrading to Oxide 2.0 as able. Plugins can be easily updated to support it as well.
  1. mcnovinho08

    mcnovinho08 Scavenger Plugin Developer

    Hi, I'm trying to make an edit in the vegod plugin, I wanted to add some time to this void.

    String userid = netuser.playerClient.userID.ToString ();

    If (! Gods.Contains (userid))
    {
    Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (true);
    Gods.Add (userid);

    }
    Else if (Gods.Contains (userid))
    {
    Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (false);
    Gods.Remove (userid);

    }
    }

    So that when the player executes the command he gains a little immortal time.
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    When exactly are you wanting him to be immortal?
     
  3. P0LENT4

    P0LENT4 Wood Hoarder Plugin Developer

    So I realize you have a list of type string

    Use / god [time]

    Code (Text):

    [ChatCommand("god")]
    void cmdGod(NetUser netuser, string command, string[] args)
    {
        string userid = netuser.playerClient.userID.ToString();
        int timer = Convert.ToInt32(args[0]);
        if (!Gods.Contains(userid))
        {
            Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (true);
            Gods.Add(userid);
            rust.Notice(netuser, string.Format("You have earned {0} seconds of GodMode"), timer);
            timer.Once(timer, ()=>
            {
                Gods.Remove(userid);
                rust.Notice(netuser, ("Your time is up, GodMode removed");
            });
        }
        else if (Gods.Contains(userid))
        {
            Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (false);
            Gods.Remove(userid);
            rust.Notice(netuser, ("You were already in godmode and it was removed.");
            return;

        }

    }
    I hope I have helped :)