Hey k1lly0u, I love your plugins. You have great ideas, and I'm planning to set up a new server soon using a lot of your free plugins. I am also planning to buy a couple of your ChaosCode plugins soon as well. I was hoping you would be willing to add in an option for your RUD plugin.
I'm trying to create a specific type of Rust experience, and I could really use this option in your plugin: Automatically revoking permission to use it if the player dies in an area where they are building blocked, and to have it then restored once they respawn, leaving their stuff behind under that specific circumstance.
The idea is that under normal circumstances, if you engage in PvP on the map, RUD will remove the loot reward incentive for KoS players. You can kill people, but you don't get their stuff. But, if you decide to raid someone, and you die in their base, they have the opportunity to take what you left behind, but not vice versa.
I would try to add the option myself, but I'm a scripter, not a coder, and I've never learned C#. I'd be happy to beta test this and anything else you put out as a small measure of compensation.
In case you are wondering why I don't just use a PvE mod/setting, I find straight PvE to be too boring and vanilla PvP to be too cutthroat these days. And PvE with specific PvP zones feels a bit too artificial, though I've already implemented that on someone else's server. But, now that I think about it, integration with Dynamic PVP to turn off your plugin while in one of their Dynamic Zones is not a bad idea either. Anyway, I've got a vision for something more balanced and nuanced for players like me that I hope others will find appealing as well.
Merged post
I got this working like I want it to, at least for part 1. My two goals are this:
In the Fields region, add:
In the Oxide Hooks region:
Add hook OnPlayerDie:
Surround the last if statement (if(!configData ...) and the RestoreData statement with an if statement check:
In the OnEntitySpawned Hook:
Surround the TakePlayerItems statement with an if statement check:
Still working on part 2.
Merged post
I got this working like I want it to, at least for part 1. My two goals are this:
In the Fields region, add:
In the Oxide Hooks region:
Add hook OnPlayerDie:
Surround the last if statement (if(!configData ...) and the RestoreData statement with an if statement check:
In the OnEntitySpawned Hook:
Surround the TakePlayerItems statement with an if statement check:
Still working on part 2.
Merged post
Part 2 turned out to be really simple. With the above code changes I already outlined, I added this check in the OnPlayerDie if statement:
I'm trying to create a specific type of Rust experience, and I could really use this option in your plugin: Automatically revoking permission to use it if the player dies in an area where they are building blocked, and to have it then restored once they respawn, leaving their stuff behind under that specific circumstance.
The idea is that under normal circumstances, if you engage in PvP on the map, RUD will remove the loot reward incentive for KoS players. You can kill people, but you don't get their stuff. But, if you decide to raid someone, and you die in their base, they have the opportunity to take what you left behind, but not vice versa.
I would try to add the option myself, but I'm a scripter, not a coder, and I've never learned C#. I'd be happy to beta test this and anything else you put out as a small measure of compensation.
In case you are wondering why I don't just use a PvE mod/setting, I find straight PvE to be too boring and vanilla PvP to be too cutthroat these days. And PvE with specific PvP zones feels a bit too artificial, though I've already implemented that on someone else's server. But, now that I think about it, integration with Dynamic PVP to turn off your plugin while in one of their Dynamic Zones is not a bad idea either. Anyway, I've got a vision for something more balanced and nuanced for players like me that I hope others will find appealing as well.
Merged post
I got this working like I want it to, at least for part 1. My two goals are this:
- Only call RUD functionality if player is killed by another player (not including suicide)
- If the player dies in an area where they are building blocked (i.e. they are raiding somewhere), their corpse becomes lootable (vanilla Rust)
In the Fields region, add:
private Dictionary<string, bool> restoreCheck = new Dictionary<string, bool>(); //set to false if player items should not be restored
In the Oxide Hooks region:
Add hook OnPlayerDie:
private void OnPlayerDie(BasePlayer player, HitInfo info)In the OnPlayerRespawned Hook:
{
var attacker = player.lastAttacker as BasePlayer;
if (attacker != null && attacker != player) //Follow normal RUD if player is killed by another player, otherwise vanilla Rust behavior
{
restoreCheck.Remove(player.UserIDString);
restoreCheck.Add(player.UserIDString,true);
}
else
{
restoreCheck.Remove(player.UserIDString);
restoreCheck.Add(player.UserIDString,false);
}
}
Surround the last if statement (if(!configData ...) and the RestoreData statement with an if statement check:
if (restoreCheck[player.UserIDString])
In the OnEntitySpawned Hook:
Surround the TakePlayerItems statement with an if statement check:
if (restoreCheck[corpse.playerSteamID.ToString()])
Still working on part 2.
Merged post
I got this working like I want it to, at least for part 1. My two goals are this:
- Only call RUD functionality if player is killed by another player (not including suicide)
- If the player dies in an area where they are building blocked (i.e. they are raiding somewhere), their corpse becomes lootable (vanilla Rust)
In the Fields region, add:
private Dictionary<string, bool> restoreCheck = new Dictionary<string, bool>(); //set to false if player items should not be restored
In the Oxide Hooks region:
Add hook OnPlayerDie:
private void OnPlayerDie(BasePlayer player, HitInfo info)In the OnPlayerRespawned Hook:
{
var attacker = player.lastAttacker as BasePlayer;
if (attacker != null && attacker != player) //Follow normal RUD if player is killed by another player, otherwise vanilla Rust behavior
{
restoreCheck.Remove(player.UserIDString);
restoreCheck.Add(player.UserIDString,true);
}
else
{
restoreCheck.Remove(player.UserIDString);
restoreCheck.Add(player.UserIDString,false);
}
}
Surround the last if statement (if(!configData ...) and the RestoreData statement with an if statement check:
if (restoreCheck[player.UserIDString])
In the OnEntitySpawned Hook:
Surround the TakePlayerItems statement with an if statement check:
if (restoreCheck[corpse.playerSteamID.ToString()])
Still working on part 2.
Merged post
Part 2 turned out to be really simple. With the above code changes I already outlined, I added this check in the OnPlayerDie if statement:
&& !player.IsBuildingBlocked()