Hello, My Servers devs an I have added the abilty to give all blueprints to players. we think this would be an nice addition to your plugin. :D
The Devs that worked on this are, Disowned, and I DeXr0.
[ConsoleCommand(CUnlockAllUserBPCmd)]
private void PlayerAdministrationUnlockAllUserBlueprintsCallback(ConsoleSystem.Arg aArg)
{
LogDebug("PlayerAdministrationUnlockAllUserBlueprintsCallback was called");
BasePlayer player = aArg.Player();
ulong targetId;
if (!VerifyPermission(ref player, CPermUnlockBP, true) || !GetTargetFromArg(ref aArg, out targetId))
return;
ProtoBuf.PersistantPlayer playerInfo = SingletonComponent<ServerMgr>.Instance.persistance.GetPlayerInfo(targetId);
foreach (ItemBlueprint itemBlueprint in ItemManager.bpList)
{
if (itemBlueprint.userCraftable && !itemBlueprint.defaultBlueprint)
{
if (!playerInfo.unlockedItems.Contains(itemBlueprint.targetItem.itemid))
playerInfo.unlockedItems.Add(itemBlueprint.targetItem.itemid);
}
}
SingletonComponent<ServerMgr>.Instance.persistance.SetPlayerInfo(targetId, playerInfo);
(BasePlayer.FindByID(targetId) ?? BasePlayer.FindSleeping(targetId))?.SendNetworkUpdateImmediate(false);
(BasePlayer.FindByID(targetId) ?? BasePlayer.FindSleeping(targetId))?.ClientRPCPlayer<int>(null, player, "UnlockedBlueprint", 0);
LogInfo($"{player.displayName}: Unlock the blueprints of user ID {targetId}");
BuildUI(player, UiPage.PlayerPage, targetId.ToString());
}r