Is it possible for a developer to create a plugin that only allows upgrade to a specific point for example if I didn't want people to be able to upgrade to armor even if they have the resources it will not let them... Is that a possibility and can someone do that?
Preventing building grades other than wood?
Discussion in 'Rust Development' started by FAxZ, Sep 29, 2017.
-
Yes, it is possible.
I would definitely start looking here: Oxide API for Rust
The `canAffordUpgrade` hook might do the trick. -
@FAxZ when looking for someone to create an actual plugin for you, you might want to post a request for it in the request section: Plugin Requests | Oxide
Code example:
Code:private object CanChangeGrade(BasePlayer player, BuildingBlock block, BuildingGrade.Enum grade) { // Check if the player is trying to upgrade to something higher than the stone tier if (grade > BuildingGrade.Enum.Stone) { // The player is upgrading past the stone tier, we don't want this. Let's notify the player and cancel the upgrade Player.Message(player, "You can't upgrade past stone."); return false; } // Player is either upgrading to wood or stone so we want the server to run its own checks return null; }