Hey there Is it possible to use a config file of another plugin? I am using a config1 of plugin1 (config1 has texts inside I want to use). I made a plugin2 which uses texts. I'd like to load config1 text to work with plugin2.
Let's use come examples of text (this is the code to create config texts)
Config1 file
Code:// Settings StringConfig("Settings", "Prefix", "MESSAGE<color=white>:</color>"); // Messages StringConfig("Messages", "Radiation", "{victim} did not know that radiation kills."); StringConfig("Messages", "Hunger", "{victim} starved to death."); StringConfig("Messages", "Thirst", "{victim} died dehydrated.");
This is the SendChatMessage void modified to use messages inside the current configs.
Plugin1 file (I wanna use this SendChatMessage inside plugin2 too but don't know what to edit to load the other config1)
Think that: string Translated = Config["Messages", msg].ToString();Code:void SendChatMessage(BasePlayer player, string prefix, string msg = null) { string Translated = Config["Messages", msg].ToString(); if(Translated != null) { SendReply(player, "<color=orange>" + prefix + "</color>: " + Translated); } else { Translated = prefix; SendReply(player, Translated); } }
is the line to edit to load config? or I have to call it from the top at the load config?
Load config of another plugin?
Discussion in 'Rust Development' started by FireBurst, Aug 30, 2015.
