Raised This Month: $32 Target: $400
 8% 

Update money count in dead spectator hud after a cs_set_user_money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-15-2017 , 07:24   Update money count in dead spectator hud after a cs_set_user_money
Reply With Quote #1

Basically this hud isn't automatically updated after a cs_set_user_money :



User need to do an action that modify other HUD parameters to update the display (such as going to another player).

How to automatically update it according to real player money ?
Fr33m@n is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-15-2017 , 08:04   Re: Update money count in dead spectator hud after a cs_set_user_money
Reply With Quote #2

Cash message isn't a hud message but still you need to wait for a couple seconds to refresh.
It isn't way to important. User is dead and he can't do anything with those dollars, unless you have a shoppy menu.
__________________
Relaxing is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-15-2017 , 10:19   Re: Update money count in dead spectator hud after a cs_set_user_money
Reply With Quote #3

I'm well aware that this isn't that much important, but the question was never about that but if it's possible and how.

Last edited by Fr33m@n; 11-15-2017 at 10:21.
Fr33m@n is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-15-2017 , 13:19   Re: Update money count in dead spectator hud after a cs_set_user_money
Reply With Quote #4

Use this stock
PHP Code:
new g_iMsgId;

public 
plugin_init( )
{
    
g_iMsgId get_user_msgid"Money" );
}

UpdatePlayerMoney( const id, const iAmount, const iShowAddedMoney )
{
    
cs_set_user_moneyidiAmount )

    
message_beginMSG_BROADCASTg_iMsgId_id );
    
write_longiAmount );
    
write_byteiShowAddedMoney )
    
message_end( );

Example:

PHP Code:
public YourFunctionid )
{
    if( 
is_user_aliveid ) )
    
UpdatePlayerMoneyid16000);

    return 
PLUGIN_CONTINUE;

__________________

Last edited by edon1337; 11-15-2017 at 13:25.
edon1337 is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-15-2017 , 14:10   Re: Update money count in dead spectator hud after a cs_set_user_money
Reply With Quote #5

Quote:
Originally Posted by Relaxing View Post
Cash message isn't a hud message but still you need to wait for a couple seconds to refresh.
It isn't way to important. User is dead and he can't do anything with those dollars, unless you have a shoppy menu.
When playing 5 vs 5 it is very nice to be able to discuss economy before the round begins.
I would very much like this plugin.
suhdude is offline
Old 11-15-2017, 15:00
HamletEagle
This message has been deleted by HamletEagle.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-16-2017 , 11:21   Re: Update money count in dead spectator hud after a cs_set_user_money
Reply With Quote #6

You have 2 ways to do this:

1.Use cs_set_user_money(id, money, 1)
2.Use the following orpheu code(1 is much better, I'm just providing this code because I already did the signature):

PHP Code:
OrpheuCall(OrpheuGetFunction("UpdateClientEffects"), idpev(idpev_iuser1)) 
Code:
{
	"name" : "UpdateClientEffects",
	"library" : "mod",
	"arguments" : 
	[
		{
			"type" : "CBasePlayer *"
		},
		{
			"type" : "int"
		}
	],
	"identifiers":
	[
		{
			"os" : "windows",
			"mod" : "cstrike",
			"value" : [0x83,"*","*",0xD9,"*","*","*","*","*",0xD8,"*","*","*","*","*",0xC6,"*","*","*","*",0xC6]
		},
		{
			"os" : "linux",
			"mod" : "cstrike",
			"value" : "_ZL19UpdateClientEffectsP11CBasePlayeri"
		}
	]
}
__________________

Last edited by HamletEagle; 11-16-2017 at 11:22.
HamletEagle 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 12:54.


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