Raised This Month: $12 Target: $400
 3% 

Check Money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConorCC
Member
Join Date: Feb 2014
Old 09-02-2021 , 03:18   Check Money
Reply With Quote #1

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.
ConorCC is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-02-2021 , 08:44   Re: Check Money
Reply With Quote #2

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.
__________________
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-02-2021 , 11:15   Re: Check Money
Reply With Quote #3

try register_messsge(get_user_msgid("Account"), "fw_msg_money")
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-02-2021 , 12:08   Re: Check Money
Reply With Quote #4

Quote:
Originally Posted by ConorCC View Post
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.
Money

This message updates the amount of money on the HUD. If the Flag is 1, the amount of money added will also be displayed.
__________________
DJEarthQuake is offline
ConorCC
Member
Join Date: Feb 2014
Old 09-02-2021 , 13:59   Re: Check Money
Reply With Quote #5

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.
ConorCC is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-02-2021 , 14:17   Re: Check Money
Reply With Quote #6

Account is a new event it shows the money on the scoreboard.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-02-2021 , 15:00   Re: Check Money
Reply With Quote #7

Quote:
Originally Posted by ConorCC View Post
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.

Post existing code that isn't clever enough.
__________________
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode