Raised This Month: $ Target: $400
 0% 

Teammates money display


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-30-2018 , 21:56   Re: Teammates money display
Reply With Quote #26

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

#define TASK_SHOWMONEY    9999

new g_pMoneyg_pFreezeTime

public plugin_init()
{
    
register_plugin("Team Money Display","0.0.3","SmileY");
    
    
g_pMoney     register_cvar("amx_display_money","1");
    
g_pFreezeTime     get_cvar_pointer("mp_freezetime")
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1)
}

public 
client_disconnect(id)
    
remove_task(id TASK_SHOWMONEY)

public 
PlayerSpawn(id)
{
    if(
get_pcvar_num(g_pMoney))
        
set_task(1.0"OnBuy"id TASK_SHOWMONEY, .flags "a", .repeat 8)
}

public 
OnBuy(id)
{
    
id -= TASK_SHOWMONEY
    
    
new iPlayers[32], iNumbool:bIsTerror bool:(get_user_team(id) == 1), szMessage[192], szName[32]
    
get_players(iPlayersiNum"e"bIsTerror "TERRORIST" "CT")
    for(new 
iiPlayer;iNum;i++)
    {
        
iPlayer iPlayers[i]
            
        
get_user_name(iPlayer,szName,charsmax(szName))
            
        if(
iPlayer != id)
        {
            
formatex(szMessagecharsmax(szMessage), "%s%s - %d$^n"szMessageszNamecs_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(idbIsTerror ?  "Terrorists:" "Counter-Terrorist:")

    
set_hudmessage(255,255,225,0.58,0.05,0,0.0,fTime,0.0,0.0,2)
    
show_hudmessage(idszMessage)


Last edited by iceeedr; 05-30-2018 at 21:59.
iceeedr is offline
Send a message via Skype™ to iceeedr
 



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 00:52.


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