C#:
using Oxide.Core;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("HealthReward", "YourName", "1.0.0")]
[Description("Gives players health points upon killing other players")]
public class HealthReward : RustPlugin
{
private const int HealthRewardAmount = 25;
private void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
{
if (info == null || info.InitiatorPlayer == null || info.damageTypes == null)
return;
var attacker = info.InitiatorPlayer;
var victim = entity as BasePlayer;
if (victim != null && attacker != victim)
{
attacker.health += HealthRewardAmount;
attacker.SendConsoleCommand("chat.add", 0, "<color=#ffa500>You have gained 25 health points for killing " + victim.displayName + "</color>");
}
}
}
}