AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Update money count in dead spectator hud after a cs_set_user_money (https://forums.alliedmods.net/showthread.php?t=302905)

Fr33m@n 11-15-2017 07:24

Update money count in dead spectator hud after a cs_set_user_money
 
Basically this hud isn't automatically updated after a cs_set_user_money :

https://image.noelshack.com/fichiers...e-dust0000.png

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 ?

Relaxing 11-15-2017 08:04

Re: Update money count in dead spectator hud after a cs_set_user_money
 
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.

Fr33m@n 11-15-2017 10:19

Re: Update money count in dead spectator hud after a cs_set_user_money
 
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.

edon1337 11-15-2017 13:19

Re: Update money count in dead spectator hud after a cs_set_user_money
 
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;



suhdude 11-15-2017 14:10

Re: Update money count in dead spectator hud after a cs_set_user_money
 
Quote:

Originally Posted by Relaxing (Post 2560604)
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.

HamletEagle 11-16-2017 11:21

Re: Update money count in dead spectator hud after a cs_set_user_money
 
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"
                }
        ]
}



All times are GMT -4. The time now is 17:38.

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