Raised This Month: $ Target: $400
 0% 

Help in this code.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-19-2011 , 20:56   Help in this code.
Reply With Quote #1

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

new Name[32]
new 
g_MsgSay  

public plugin_init()
{
    
register_plugin("RoundStart Money""1.2""krm")
    
    
register_event("HLTV""RoundStart_Money""a""1=0""2=0"
    
    
g_MsgSay get_user_msgid "SayText" )  
}

public 
RoundStart_Money()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum"ch")
    
    for(new 
iiNumi++)
    {
        
get_user_name(iPlayers[i], Name31)
        
        if(
cs_get_user_team(iPlayers[i]) == CS_TEAM_CT)
        {
            
print_colored(iPlayers[i], "!n(Counter-Terrorist)!t %s!n :  $%i"Namecs_get_user_money(iPlayers[i]))
        }
        
        if(
cs_get_user_team(iPlayers[i]) == CS_TEAM_T)
        {
            
print_colored(iPlayers[i], "!n(Terrorist)!t %s!n :  $%i"Namecs_get_user_money(iPlayers[i]))
        }
    }
}

stock print_colored ( const index, const input [ ], const any:... )
{
    new 
players 32 ]
    new 
count
    
new message 191 ]
    new 
i
    
    count 
1
    
    vformat 
message190input)
    
    
replace_all message190"!n""^1" )
    
replace_all message190"!t""^3" )
    
replace_all message190"!g""^4" )
    
    if ( 
index )
    {
        
players ] = index
    
}
    
    else
    {
        
get_players playerscount"ch" )
    }
    
    for ( 
0count++ )
    {
        if ( 
is_user_connected players ] ) )
        {
            
message_begin MSG_ONE_UNRELIABLEg_MsgSay_players ] )
            
write_byte players ] )
            
write_string message )
            
message_end ( )
        }
    }

I need the money to show her entire team, but, is not working. Can anyone help me?

Thx
__________________

Last edited by kramesa; 12-19-2011 at 21:00.
kramesa is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-19-2011 , 22:05   Re: Help in this code.
Reply With Quote #2

Why don't let the game do that for you ?

PHP Code:
    register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
}

public 
Event_HLTV_New_Round()
{
    
set_task(0.1"ShowMoney")
}

public 
ShowMoney()
{
    new 
iPlayers[32], iNumszSaid[8]
    
get_players(iPlayersiNum"ah")
    for(--
iNumiNum>=0iNum--)
    {
        
id iPlayers[iNum]
        
formatex(szSaidcharsmax(szSaid), "$ %d"cs_get_user_money(id))
        
engclient_cmd(id"say_team"szSaid)
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-19-2011 at 22:12.
ConnorMcLeod is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-19-2011 , 22:16   Re: Help in this code.
Reply With Quote #3

Thanks, works perfectly.
__________________

Last edited by kramesa; 12-20-2011 at 10:26.
kramesa is offline
Reply



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


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