1. Hello,

    I want make some plugin on rust to spawn some structure when the server is initialized. There is many event handler in oxide's documentation but this isn't what i want. So i started to look some plugin and i find one who build foundation where the player look. I look the code

    Code:
    /////////////////////////////////////////////////////
            ///  SpawnStructure()
            ///  Function to spawn a block structure
            /////////////////////////////////////////////////////
            private static void SpawnStructure(string prefabname, Vector3 pos, Quaternion angles, BuildingGrade.Enum grade, float health)
            {
                GameObject prefab = GameManager.server.CreatePrefab(prefabname, pos, angles, true);
                if (prefab == null)
                {
                    return;
                }
                BuildingBlock block = prefab.GetComponent<BuildingBlock>();
                if (block == null) return;
                block.transform.position = pos;
                block.transform.rotation = angles;
                block.gameObject.SetActive(true);
                block.blockDefinition = PrefabAttribute.server.Find<Construction>(block.prefabID);
                block.Spawn();
                block.SetGrade(grade);
                if (health <= 0f)
                    block.health = block.MaxHealth();
                else
                    block.health = health;
                block.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
            }
    
    How do you find that there is a function 'Spawn'? I didn't find any ide for oxide C#. Do you have one?

    Anyone could help me?
     
  2. Wulf

    Wulf Community Admin

    What you are looking for is in Rust itself, not Oxide. You'd need to use a .NET decompiler such as JustDecompiler and look through Rust's Assembly-CSharp.dll.