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
How do you find that there is a function 'Spawn'? I didn't find any ide for oxide C#. Do you have one?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); }
Anyone could help me?
Spawning a structure on server start?
Discussion in 'Rust Development' started by [LVG] . Hoax, Sep 20, 2016.