Hi Guys,
I'm developing a plugin that consists of teleporting a player and using Kits plugin to give them preset items. Before the player is teleported, I clear their inventory and then use kits afterwards.
This works until a certain point (as it appears), where items don't seem to refresh correctly. What I mean by that is anytime a player:
1. Drops an item from inventory to the groud
2. Uses a stacked item such as first aid kit
The item still appears to be in their invenotory (even though it isn't).
What seems to refresh the state is when a player switches an active weapon in the invenotory (selects a different belt item), or sits down on a chair.
I'm trying to figure out what would cause the item refresh to stop working. Thought I'd reach out to the cummunity as someone more experienced than me may already have an answer. if not, I'll keep digging.
Thank you in advance!
Inventory Items Not Refreshing
From your description, it looks like the modified info is not propagating to clients.
are you using the MarkDirty(); and SendNetworkUpdate(); function after modifying container inventory ?
Thank you for the suggestion. Im going to give this a try and see if it helps.
Lorenzo
From your description, it looks like the modified info is not propagating to clients.
are you using the MarkDirty(); and SendNetworkUpdate(); function after modifying container inventory ?
Okay so basically for whatever reason the server doesn't send player.SendNetworkUpdate() after something in inventory changes. When doing this for example, the issue went away for healing items:
object OnHealingItemUse(MedicalTool tool, BasePlayer player)
{
player.SendNetworkUpdate();
return null;
}The thing is... I shouldn't be having to do this manually. So is there some sort of subscription mechanism that I accidentally unsubscribe players from? Any ideas why this is not called?