Raised This Month: $62 Target: $400
 15% 

Teammates money display


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Statistical       
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-15-2017 , 17:02   Teammates money display
Reply With Quote #1

Hi, i already know that has already posted i guess.
But this plugin have two small features:

- Display only in freezetime and according freezetime value;
- Also values are updated according players buy items.


PHP Code:
#include <amxmodx>
#include <cstrike>

#pragma semicolon 1

new g_pMoney;
new 
g_pFreezeTime;

new 
bool:g_bDisplay;

public 
plugin_init()
{
    
register_plugin("Team Money Display","0.0.3","SmileY");

    
g_pMoney     create_cvar("amx_display_money","1",FCVAR_NONE,"Display Teammate money");
    
g_pFreezeTime     get_cvar_pointer("mp_freezetime");

    
register_logevent("fnRoundStart",2,"1=Round_Start");
    
register_logevent("fnRoundEnd",2,"1=Round_End");
}

public 
fnRoundstart()
{
    
g_bDisplay false;
}

public 
fnRoundEnd()
{
    
g_bDisplay = (get_pcvar_num(g_pMoney) ? true false;
}

public 
CS_OnBuy(id,iWeapon)
{
    if(
g_bDisplay)
    {
        new 
szTeam[13];
        
get_user_team(id,szTeam,charsmax(szTeam));

        new 
iPlayers[MAX_PLAYERS],iNum,iPlayer;
        
get_players(iPlayers,iNum,"aeh",szTeam);

        new 
szName[MAX_NAME_LENGTH],szHud[512];

        for(new 
i;iNum;i++)
        {
            
iPlayer iPlayers[i];

            
get_user_name(iPlayer,szName,charsmax(szName));

            
format
            
(
                
szHud,
                
charsmax(szHud),
                
"%s%s $ %d^n",
                
szHud,
                
szName,
                
cs_get_user_money(iPlayer)
            );
        }

        new 
Float:fTime get_pcvar_float(g_pFreezeTime);

        if(
fTime 2.0)
        {
            
fTime 2.0;
        }

        
set_hudmessage(0,255,0,0.58,0.02,0,0.0,fTime,0.0,0.0,1);
        
show_hudmessage(id,(szTeam[0] == 'C') ? "Counter-Terrorist:" "Terrorists:");
    
        
set_hudmessage(255,255,225,0.58,0.05,0,0.0,fTime,0.0,0.0,2);
        
show_hudmessage(id,szHud);
    }

Ps. Also is needed the last hg dev (Or some that supports CS_OnBuy and create_cvar func.

Thanks
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar,get_pcvar_num(pCvar) ? 1); 

Last edited by ^SmileY; 03-17-2017 at 11:40. Reason: Updated 0.0.3
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Blizzard_87
AlliedModders Donor
Join Date: Oct 2012
Old 03-17-2017 , 07:22   Re: Teammates money display
Reply With Quote #2

does this plugin allow you to point to other team mates and see a hud above them showing there money?

cos thats what the title of this thread translates to me.. but i dont see that in the code.... ?

you should also Cache "get_pcvar_num(g_pMoney)" in round start or end. so it doesnt call to many times every time someone buys something..?
__________________

Last edited by Blizzard_87; 03-17-2017 at 07:25.
Blizzard_87 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-17-2017 , 08:29   Re: Teammates money display
Reply With Quote #3

Quite different actually.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-17-2017 , 11:30   Re: Teammates money display
Reply With Quote #4

Quote:
Originally Posted by Blizzard_87 View Post
does this plugin allow you to point to other team mates and see a hud above them showing there money?

cos thats what the title of this thread translates to me.. but i dont see that in the code.... ?

you should also Cache "get_pcvar_num(g_pMoney)" in round start or end. so it doesnt call to many times every time someone buys something..?
good tip, i do not tested plugin, since a friend requested it.

Ps. Updated
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar,get_pcvar_num(pCvar) ? 1); 

Last edited by ^SmileY; 03-17-2017 at 11:41.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
sekac
Senior Member
Join Date: Nov 2016
Old 05-18-2018 , 15:01   Re: Teammates money display
Reply With Quote #5

PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "create_cvar" on line 15
Error
Expected token")"but found ";" on line 29
Error
Undefined symbol "MAX_PLAYERS" on line 39
Error
Invalid expressionassumed zero on line 39
Error
Undefined symbol "iNum" on line 39
Error
Too many error messages on one line on line 39

Compilation aborted
.
6 Errors.
Could not locate output file I:\Documents\AMXX Compiler\yadando\show_teammates_money.amx (compile failed). 
sekac is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-18-2018 , 16:24   Re: Teammates money display
Reply With Quote #6

Quote:
Originally Posted by sekac View Post
PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "create_cvar" on line 15
Error
Expected token")"but found ";" on line 29
Error
Undefined symbol "MAX_PLAYERS" on line 39
Error
Invalid expressionassumed zero on line 39
Error
Undefined symbol "iNum" on line 39
Error
Too many error messages on one line on line 39

Compilation aborted
.
6 Errors.
Could not locate output file I:\Documents\AMXX Compiler\yadando\show_teammates_money.amx (compile failed). 

Ps. Also is needed the last hg dev (Or some that supports CS_OnBuy and create_cvar func.
iceeedr is offline
Send a message via Skype™ to iceeedr
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-18-2018 , 17:01   Re: Teammates money display
Reply With Quote #7

Translation: the latest AMXX 1.8.3 version is required.
You can easily make it compatible for 1.8.2 too.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-21-2018 , 09:26   Re: Teammates money display
Reply With Quote #8

Quote:
Originally Posted by sekac View Post
PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "create_cvar" on line 15
Error
Expected token")"but found ";" on line 29
Error
Undefined symbol "MAX_PLAYERS" on line 39
Error
Invalid expressionassumed zero on line 39
Error
Undefined symbol "iNum" on line 39
Error
Too many error messages on one line on line 39

Compilation aborted
.
6 Errors.
Could not locate output file I:\Documents\AMXX Compiler\yadando\show_teammates_money.amx (compile failed). 
a bit non steammer here
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar,get_pcvar_num(pCvar) ? 1); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-21-2018 , 11:25   Re: Teammates money display
Reply With Quote #9

Which part of the compile log says "non-steam"?!
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
sekac
Senior Member
Join Date: Nov 2016
Old 05-21-2018 , 15:24   Re: Teammates money display
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
Which part of the compile log says "non-steam"?!
Maybe a reference to one of my recent posts where I busted a no-steamer.
sekac 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 01:07.


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