Hello! I am currently trying to unlock all of the items for a player. I have been able to give a player XP, but I just want to be able to unlock all items for a player.
I noticed that players still have PlayerBlueprints which contains the function Unlock(ItemDefinition).
Do anyone know where how I can find or create the list of ItemDefinitions that players can unlock? If this will even work
[DOUBLEPOST=1467933484][/DOUBLEPOST]Nevermind! I figured it out! My old code still works
For anyone wondering:
Code:foreach(ItemDefinition i in ItemManager.itemList) { player.blueprints.Unlock(i); }
Unlocking all items for players?
Discussion in 'Rust Development' started by The FSM, Jul 8, 2016.
-
how did u unlock it for every one ?
-
Hi are you sure this is working? It loops through all the items, but in testing just now it doesn't appear to unlock anything for me in game.
-
You also have to give experience in order to level up the player in order to craft items. Just because it is "unlocked" doesn't mean you are high enough level to do it. -
Code:
void Regalos(BasePlayer player) { if (!player.IsAdmin()) return; foreach (BasePlayer jugador in BasePlayer.activePlayerList) { AddLevel(jugador, 50); } } void AddLevel(BasePlayer player, int level) { float currentlevel = player.xp.CurrentLevel; float leveltoxp = Rust.Xp.Config.LevelToXp((int)currentlevel + level); player.xp.Reset(); player.xp.Add(Rust.Xp.Definitions.Cheat, leveltoxp); }
-
-
@Caffeine Yes, It is still working. However @Reynostrum posted a very good solution for giving a specfic level. If you would like you can PM me and I can help you out
-
Code:
foreach(ItemDefinition i in ItemManager.itemList) { player.blueprints.Unlock(i); }
-
-
-
-
Wulf Community Admin
I'll likely be posting a more advanced version of it soon, but I'll probably be keeping it pretty basic. -
-
XpBooster for Rust | Oxide
Also few other people released some Xp plugins already XP Equalizer for Rust | Oxide and XP Death Reducer for Rust | Oxide -