Hello, how could I re-enable HUD elements such as cash when the player is off duty?
I've hooked into the onOnDutyChanged event in my plugin as such:
public override void Initialize()
{
Functions.OnOnDutyStateChanged += CashController.OnOnDutyStateChangedHandler;
}
and here is what I do in my CashController class:
public static void OnOnDutyStateChangedHandler(bool onDuty)
{
currentlyOnDuty = onDuty;
if (!onDuty)
{
//The false here is weird, but: https://nativedb.dotindustries.dev/gta5/natives/0x96DEC8D5430208B7
NativeFunction.Natives.DISPLAY_CASH(false);
GameFiber cashFiber = GameFiber.StartNew(showCash);
return;
}
NativeFunction.Natives.DISPLAY_CASH(true);
}
private static void showCash()
{
while (!currentlyOnDuty)
{
NativeFunction.Natives.SHOW_HUD_COMPONENT_THIS_FRAME(3);
GameFiber.Wait(10000);
}
}
Am I missing something, or is the natives I call wrong / incorrectly implemented? The ultimate goal is to be able to see money like you can outside of LSPDFR, with the button Z.
Thank you to anyone reading this!