I have a small plugin. shows who broke the tool cupboard
example: player has broken Kurbandark’s Tool Cupboard
I want my plugin to keep a record, can you help me. ı need log file
I have a small plugin. shows who broke the tool cupboard
example: player has broken Kurbandark’s Tool Cupboard
I want my plugin to keep a record, can you help me. ı need log file
namespace Oxide.Plugins
{
[Info("Tc Broken", "SSS", "1.0.0")]
[Description("For Rust Türkiye tournament")]
class TcBroken: RustPlugin
{
void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
{
if (!(entity is BuildingPrivlidge)) return;
var Player1 = covalence.Players.FindPlayerById(entity.OwnerID.ToString()).Name;
var Player2 = info.InitiatorPlayer.displayName;
var TcOwner = covalence.Players.FindPlayerById(entity.OwnerID.ToString()).Name;
covalence.Server.Broadcast(Player2 + " Adlı Oyuncu " + TcOwner + " İnşa Dolabını Kırdı ");
}
}
} namespace Oxide.Plugins
{
[Info("TC Broken", "Author Name", "1.0.0")]
[Description("Shows who destroyed a tool cupboard")]
class TcBroken: CovalencePlugin
{
private void OnEntityDeath(BuildingPrivlidge cupboard, HitInfo info)
{
BasePlayer owner = BasePlayer.FindByID(cupboard.OwnerID);
BasePlayer attacker = info?.InitiatorPlayer;
if (owner != null && attacker != null)
{
server.Broadcast($"{attacker.displayName} destroyed the tool cupboard for {owner.displayName}");
}
}
}
}
server.Broadcast($"{attacker.displayName} destroyed the tool cupboard for {owner.displayName}");With:LogToFile("filename", $"{attacker.displayName} destroyed the tool cupboard for {owner.displayName}"); LogToFile("filename", $"{attacker.displayName} destroyed the tool cupboard for {owner.displayName}", this);Wulf
--snip--
Its a bit complicated when somebody asking that kind of questions. Maybe it will be better if you will make special forum? Like "Developing Questions". I remember there was similar before
using System;
namespace Oxide.Plugins
{
[Info("TC Broken", "Author Name", "1.0.0")]
[Description("Shows who destroyed a tool cupboard")]
class TcBroken: CovalencePlugin
{
private void OnEntityDeath(BuildingPrivlidge cupboard, HitInfo info)
{
BasePlayer owner = BasePlayer.FindByID(cupboard.OwnerID);
BasePlayer attacker = info?.InitiatorPlayer;
if (owner != null && attacker != null)
{
server.Broadcast($"{owner.displayName} Adlı Oyuncunun İnşaat Dolabı {attacker.displayName} Adlı Oyuncu Tarafından Kırıldı.");
LogToFile("filename", $"[{DateTime.Now}] {owner.displayName} Adlı Oyuncunun İnşaat Dolabı {attacker.displayName} Adlı Oyuncu Tarafından Kırıldı.", this);
}
}
}
}