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

Teammates money display


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   Counter-Strike        Category:   Statistical       
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-15-2017 , 16: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)); 

Last edited by ^SmileY; 03-17-2017 at 10:40. Reason: Updated 0.0.3
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 



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 08:01.


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