I'm making an all items plugin for the XP system and I wanted to know the way to do this, it is possible, I've seen it on battlefield servers, just they didn't have all the bps unlocked.
Solved Making XP/levels impossible to gain
Discussion in 'Rust Development' started by Kappasaurus, Jul 10, 2016.
-
Wulf Community Admin
If you don't want to earn XP, just return 0 in the OnEarnXp hook.
-
Is it possible you could give me an example? Also, thanks for adding the hooks
-
Wulf Community Admin
object OnEarnXp(BasePlayer player, float amount) => 0f; -
thanks
[DOUBLEPOST=1468124678][/DOUBLEPOST]Wait
"Unexpected symbol, "float" -
Wulf Community Admin
I'd need to see what you have, but it sounds like you're missing something. -
I'm not using the latest Oxide version, but the one before that, I don't want to update because the crash reports.
Were the hooks in that version? -
Wulf Community Admin
Most of the crash reports have been users not actually being updated. The hooks are the same as they've been in the past few updates. -
[DOUBLEPOST=1468127820][/DOUBLEPOST]Code:
namespace Oxide.Plugins { [Info("AllItems", "Kappasaurus", "0.1.0")] [Description("Unlocks items without spending XP")] class AllItems : RustPlugin { void OnPlayerInit(BasePlayer player) { foreach (var item in ItemManager.itemList) player.blueprints.Unlock(item); object OnEarnXp(BasePlayer player, float amount) => 0f; } } }Ok, I'll update on next restart, but there isn't a client update so I suppose it isn't urgent. -
Wulf Community Admin
You can't put a hook inside another hook.
-
Thanks
-
Unlocked items will not displayed on client if his level lower than item unlock level, so you need to set players levels too.
