Check Money
Hey there!
Effective way to hook money change? I didn't find any solution. Maybe because it is not possible. I want to see the increment or decrement value and not the result value. |
Re: Check Money
I don't think there is a simple solution. Plugins can either use cs_set_ser_money(so you could hook Money message) or directly set m_iAccount with set_pdata_int. To detect the latter you will have to hook set_pdata_int with orpheu. Then you also need to check when the game updates the user's money, but this will likely be easier, as there are fewer places where it happens(buy menu, round bonuses, etc).
This approach isn't that great and doesn't account for 3rd party modules updating money. Another way would be to try some kind of brute force approach. Hook something like PreThink or a thinking entity with a small think time and constantly check if the money amount was changed. |
Re: Check Money
try register_messsge(get_user_msgid("Account"), "fw_msg_money")
|
Re: Check Money
Quote:
This message updates the amount of money on the HUD. If the Flag is 1, the amount of money added will also be displayed. |
Re: Check Money
I don't think Account is a real event. It is not listed on this page https://wiki.alliedmods.net/Half-Life_1_Game_Events
And the Money one only delivering the new value. I just want to hook the basic money changes like bomb plant, kill, win or lose. For now I doing this with different events and logevents. But I want to do it more clever. That's why I ask. |
Re: Check Money
Account is a new event it shows the money on the scoreboard.
|
Re: Check Money
Quote:
Post existing code that isn't clever enough. |
| All times are GMT -4. The time now is 02:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.