This is an Arma Reforger Addon that redresses the player in an equipment loadout. It's a neat example of how to spawn items on the server and then have the client equip them, as this has a few quirks you have to know about with the current arma reforger patch.
HUGE thanks to klamacz from BI, who tirelessly helped me figure all this out. Thanks so much, you're a legend!
The code is here: https://github.com/democore/ReforgerLoadout/tree/master/Scripts/Game/LoadoutManager
The current workflow is
- User presses F on a entity that has the BEAR_LoadoutAction
- Server receives the PerformAction and starts logic in BEAR_LoadoutAction.c
- Server spawns items at the player location BEAR_LoadoutAction.c
- Tells the player they were spawned with Rpc BEAR_LoadoutAction.c
- The client then waits until the items are replicated BEAR_LoadoutPlayerNetworkFixComponent.c
- Once the items are replicated, they are equip on client side BEAR_LoadoutPlayerNetworkFixComponent.c
Note: As of right now, this addon uses 4 dependencies from the workshop. I'll remove them when I have time. Until then, you can manually remove them by removing them from the addons settings and the resources from the config file.
🐻