roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
742 stars 111 forks source link

Player's money not updating on HUD #397

Closed WeirdPhrog closed 4 months ago

WeirdPhrog commented 4 months ago

Hi, when I give a player some money during freeze time, the player doesn't see any changes on HUD until freeze time ends. Please help.

I tried Utilities.SetStateChanged(playerPawn!, "CCSPlayerController_InGameMoneyServices", "m_iAccount"); but nothing changed.

v 204

roflmuffin commented 4 months ago

Do this instead, it needs to be done on the controller not the pawn, and the item to mark as state changed should be the whole reference to money services.

SetStateChanged(controller, "CCSPlayerController", "m_pInGameMoneyServices");

WeirdPhrog commented 4 months ago

Thank you!