Максимальная производительность для ваших игровых серверов!
Заказать сейчасusing System.Collections.Generic;
using uLink;
namespace Oxide.Plugins
{
[Info("CustomDeathMessages", "Trentu", "1.0.4")]
[Description("Just displays custom death messages.")]
class CustomDeathMessages : HurtworldPlugin
{
protected override void LoadDefaultConfig()
void LoadDefaultMessages()
{
var messages = new Dictionary<string, string>
{
{"EntityStats/Sources/Fall Damage","{Name} разбился насмерть"},
{"EntityStats/Sources/Damage Over Time","{Name} just died"},
{"EntityStats/Sources/Radiation Poisoning","{Name} just died"},
{"EntityStats/Sources/Starvation","{Name} just died"},
{"EntityStats/Sources/Hypothermia","{Name} just died"},
{"EntityStats/Sources/Asphyxiation","{Name} just died"},
{"EntityStats/Sources/Poison","{Name} just died"},
{"EntityStats/Sources/Burning","{Name} just died"},
{"EntityStats/Sources/Suicide","{Name} committed suicide"},
{"EntityStats/Sources/Explosives","{Name} dead by explosion"},
{"EntityStats/Sources/a Vehicle Impact","{Name} killed by a car"},
{"Creatures/Tokar","{Name} got killed by Tokar"},
{"Creatures/Shigi","{Name} got killed by a Shigi"},
{"Creatures/Bor","{Name} got killed by a Bor"},
{"Creatures/Yeti","{Name} got killed by a Yeti"},
{"player","{Name} got killed by {Killer}"},
{"Unknown","{Name} just died on a mystic way"}
};
lang.RegisterMessages(messages, this);
}
void Loaded() => LoadDefaultMessages();
string GetNameOfObject(UnityEngine.GameObject obj){
//NetworkView view = obj.GetComponent<uLink.NetworkView>();
var ManagerInstance = GameManager.Instance;
return ManagerInstance.GetDescriptionKey(obj);
}
object OnDeathNotice(string name, EntityEffectSourceData source)
{
string KillerName = GetNameOfObject(source.EntitySource);
if(KillerName == ""){
hurt.BroadcastChat((lang.GetMessage(source.SourceDescriptionKey, this) ?? lang.GetMessage("Unknown", this)).Replace("{Name}", name));
}else{
hurt.BroadcastChat((lang.GetMessage(source.SourceDescriptionKey, this) ?? lang.GetMessage("player", this)).Replace("{Name}", name).Replace("{Killer}", KillerName));
}
return true;
}
}
}
{"EntityStats/Sources/Fall Damage","<color=#ff0000>{Name}</color> разбился насмерть"},
потому как код идет другой под это делоКод:using System.Collections.Generic; using uLink; namespace Oxide.Plugins { [Info("CustomDeathMessages", "Trentu", "1.0.4")] [Description("Just displays custom death messages.")] class CustomDeathMessages : HurtworldPlugin { protected override void LoadDefaultConfig() void LoadDefaultMessages() { var messages = new Dictionary<string, string> { {"EntityStats/Sources/Fall Damage","{Name} разбился насмерть"}, {"EntityStats/Sources/Damage Over Time","{Name} just died"}, {"EntityStats/Sources/Radiation Poisoning","{Name} just died"}, {"EntityStats/Sources/Starvation","{Name} just died"}, {"EntityStats/Sources/Hypothermia","{Name} just died"}, {"EntityStats/Sources/Asphyxiation","{Name} just died"}, {"EntityStats/Sources/Poison","{Name} just died"}, {"EntityStats/Sources/Burning","{Name} just died"}, {"EntityStats/Sources/Suicide","{Name} committed suicide"}, {"EntityStats/Sources/Explosives","{Name} dead by explosion"}, {"EntityStats/Sources/a Vehicle Impact","{Name} killed by a car"}, {"Creatures/Tokar","{Name} got killed by Tokar"}, {"Creatures/Shigi","{Name} got killed by a Shigi"}, {"Creatures/Bor","{Name} got killed by a Bor"}, {"Creatures/Yeti","{Name} got killed by a Yeti"}, {"player","{Name} got killed by {Killer}"}, {"Unknown","{Name} just died on a mystic way"} }; lang.RegisterMessages(messages, this); } void Loaded() => LoadDefaultMessages(); string GetNameOfObject(UnityEngine.GameObject obj){ //NetworkView view = obj.GetComponent<uLink.NetworkView>(); var ManagerInstance = GameManager.Instance; return ManagerInstance.GetDescriptionKey(obj); } object OnDeathNotice(string name, EntityEffectSourceData source) { string KillerName = GetNameOfObject(source.EntitySource); if(KillerName == ""){ hurt.BroadcastChat((lang.GetMessage(source.SourceDescriptionKey, this) ?? lang.GetMessage("Unknown", this)).Replace("{Name}", name)); }else{ hurt.BroadcastChat((lang.GetMessage(source.SourceDescriptionKey, this) ?? lang.GetMessage("player", this)).Replace("{Name}", name).Replace("{Killer}", KillerName)); } return true; } } }
Вот код который у нас сейчас.
Пробовал сделать, не получилось.Просто никакой реакции на это. Хэлп ребята...!!!Код:{"EntityStats/Sources/Fall Damage","<color=#ff0000>{Name}</color> разбился насмерть"},
Ты пытаешься править сам плагин что ли?Код:using System.Collections.Generic; using uLink; namespace Oxide.Plugins { [Info("CustomDeathMessages", "Trentu", "1.0.4")] [Description("Just displays custom death messages.")] class CustomDeathMessages : HurtworldPlugin { protected override void LoadDefaultConfig() void LoadDefaultMessages() { var messages = new Dictionary<string, string> { {"EntityStats/Sources/Fall Damage","{Name} разбился насмерть"}, {"EntityStats/Sources/Damage Over Time","{Name} just died"}, {"EntityStats/Sources/Radiation Poisoning","{Name} just died"}, {"EntityStats/Sources/Starvation","{Name} just died"}, {"EntityStats/Sources/Hypothermia","{Name} just died"}, {"EntityStats/Sources/Asphyxiation","{Name} just died"}, {"EntityStats/Sources/Poison","{Name} just died"}, {"EntityStats/Sources/Burning","{Name} just died"}, {"EntityStats/Sources/Suicide","{Name} committed suicide"}, {"EntityStats/Sources/Explosives","{Name} dead by explosion"}, {"EntityStats/Sources/a Vehicle Impact","{Name} killed by a car"}, {"Creatures/Tokar","{Name} got killed by Tokar"}, {"Creatures/Shigi","{Name} got killed by a Shigi"}, {"Creatures/Bor","{Name} got killed by a Bor"}, {"Creatures/Yeti","{Name} got killed by a Yeti"}, {"player","{Name} got killed by {Killer}"}, {"Unknown","{Name} just died on a mystic way"} }; lang.RegisterMessages(messages, this); } void Loaded() => LoadDefaultMessages(); string GetNameOfObject(UnityEngine.GameObject obj){ //NetworkView view = obj.GetComponent<uLink.NetworkView>(); var ManagerInstance = GameManager.Instance; return ManagerInstance.GetDescriptionKey(obj); } object OnDeathNotice(string name, EntityEffectSourceData source) { string KillerName = GetNameOfObject(source.EntitySource); if(KillerName == ""){ hurt.BroadcastChat((lang.GetMessage(source.SourceDescriptionKey, this) ?? lang.GetMessage("Unknown", this)).Replace("{Name}", name)); }else{ hurt.BroadcastChat((lang.GetMessage(source.SourceDescriptionKey, this) ?? lang.GetMessage("player", this)).Replace("{Name}", name).Replace("{Killer}", KillerName)); } return true; } } }
Вот код который у нас сейчас.
Пробовал сделать, не получилось.Просто никакой реакции на это. Хэлп ребята...!!!Код:{"EntityStats/Sources/Fall Damage","<color=#ff0000>{Name}</color> разбился насмерть"},
Там надо и так и так его подправлять, так как там выдает сообщение: [SERVER] Verhovniy был убит кабаном.Ты пытаешься править сам плагин что ли?
Вроде как после запуска должен создаться конфиг для подмены цветов и так далее
А сам плагин зачем менять там другой язык программирования и ты туда тыкаешь html код, конечно не будет работать