In response to Wulf ():So something still null in that method, likely something with the player or crest. I'd suggest addin...
Problems solved.
There are two things that I have learned and that have caused all the problems:
So the only thing that is left for me to ask at this point is if there's any way I can monitor the amound of resources each player gathers and if you know no way I would like to ask you to create a Hook for the Chest/ContainerOpenEvent and the Chest/ContainerCloseEvent or what might be even better would be one Hook that is called for all Events, each and everyone of them, so that one can then distinguish which kind of Event the Event is, that has been passed on after it called the Hook, just like with the
That way there would only be the need to create one Hook to enable the players to work with every Event they please, which I would really appreciate.
I hope you think about adding this "universal" Hook and I would be very grateful if you would decide to do so.
There are two things that I have learned and that have caused all the problems:
- You can't put Reign of Kings-Players in any kind of Collection. Not in
List<T>s nor inDictionary<TKey,TValue>s or anything else. Server.AllPlayersdoes infact not contain all Players and you can't get each Player withServer.GetPlayerById(ulong playerId)nor withServer.GetPlayerByName(string playerName)either, because the first one only contains "all" players that are online and the latter can only get a player by name or id if said player is online, too. But what does infact contains all Players, or more accurate all IPlayers iscovalence.Players.All. Even though it is a little inconvenient that theIPlayer.Idis a string and not a ulong like the Reign of Kings-Player.Id, the problem is easily solved with two lines of codeulong Id = 0;andulong.TryParse(Iplayer.Id, out Id);.
ulong.TryParse(Iplayer.Id, out ulong Id);, but in practice Reign of Kings will not accept this and you will get a strange compiler error.)So the only thing that is left for me to ask at this point is if there's any way I can monitor the amound of resources each player gathers and if you know no way I would like to ask you to create a Hook for the Chest/ContainerOpenEvent and the Chest/ContainerCloseEvent or what might be even better would be one Hook that is called for all Events, each and everyone of them, so that one can then distinguish which kind of Event the Event is, that has been passed on after it called the Hook, just like with the
OnPlayerChat-Hook which seems to get called for multiple chat related Events like the PlayerWhisperEvent, the GuildMessageEvent and the PlayerLocalChatEvent etc. Later on you can use if statements to determine which Event it actually was.That way there would only be the need to create one Hook to enable the players to work with every Event they please, which I would really appreciate.
I hope you think about adding this "universal" Hook and I would be very grateful if you would decide to do so.