Raised This Month: $32 Target: $400
 8% 

[HELP] Chat money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
faKe91
Member
Join Date: Jan 2012
Location: Moldova, Chisinau
Old 09-05-2013 , 07:33   [HELP] Chat money
Reply With Quote #1

Hello. I have this code

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

#define PLUGIN "Show Money"
#define VERSION "1.0"
#define AUTHOR "somebody"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
}

public 
player_spawn(client)
{
    
set_task(1.0"show_money"client)
}

public 
show_money(id)
{
    new 
iMoney;
    new 
money_Buffer[100+1];
    
iMoney cs_get_user_money(id);
    
formatmoney_Buffer100"$%d"iMoney );
    
engclient_cmdid"say_team"money_Buffer );

I want that amount of money appears in chat after the second round, because it is clear that all starts with $800. I'm glad if someone helps me

Last edited by faKe91; 09-05-2013 at 07:36.
faKe91 is offline
Cheezpuff
BANNED
Join Date: Oct 2012
Location: City of the Dead
Old 09-05-2013 , 08:11   Re: [HELP] Chat money
Reply With Quote #2

Quote:
Originally Posted by faKe91 View Post
Hello. I have this code

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

#define PLUGIN "Show Money"
#define VERSION "1.0"
#define AUTHOR "somebody"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
}

public 
player_spawn(client)
{
    
set_task(1.0"show_money"client)
}

public 
show_money(id)
{
    new 
iMoney;
    new 
money_Buffer[100+1];
    
iMoney cs_get_user_money(id);
    
formatmoney_Buffer100"$%d"iMoney );
    
engclient_cmdid"say_team"money_Buffer );

I want that amount of money appears in chat after the second round, because it is clear that all starts with $800. I'm glad if someone helps me
check:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >

new g_iMaxPlayersi;

public 
plugin_init() 
{
    
    
register_logevent"logevent_round_start"2"1=Round_Start" );
    
    
g_iMaxPlayers get_maxplayers( );
}


public 
logevent_round_start( )
{
    for( 
<= g_iMaxPlayers ++ )
    {
        if( !
is_user_connected) )
            continue;
            
        
client_cmdi"say_team %i$"cs_get_user_money) );
    }

Cheezpuff is offline
Send a message via Skype™ to Cheezpuff
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-05-2013 , 08:50   Re: [HELP] Chat money
Reply With Quote #3

With your method dead players would print their money too.
Use get_players for that.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "Print Money"
#define VERSION "1.0.0"
#define AUTHOR "Kia"

// ===============================================================================
//     plugin_init
// ===============================================================================

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
/* Logevents */
    
    
register_logevent("LogEvent_RoundStart"2"1=Round_Start")  
}

// ===============================================================================
//     LogEvent_RoundStart - Called when a round starts
// ===============================================================================

public LogEvent_RoundStart()
{
    new 
players[32], pnumid
    get_players
(playerspnum"a")
    
    for( new 
ii<pnumi++ ) 
    {
        
id players[i]
        
        
client_cmd(id"say_team $%i"cs_get_user_money(id))
    }

__________________

Last edited by Kia; 09-05-2013 at 10:07.
Kia is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 09-05-2013 , 08:59   Re: [HELP] Chat money
Reply With Quote #4

O.o ??

PHP Code:
register_logevent("LogEvent_RoundStart"2"1=Round_Start")

public 
LogEvent_RoundEnd(){ 
__________________
I wouldn’t marry you even if you were the last woman left on earth

Choose_Your_Destiny is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-05-2013 , 10:07   Re: [HELP] Chat money
Reply With Quote #5

Sorry, forgot you don't use MetaMagic, fixed the typo.
__________________
Kia is offline
faKe91
Member
Join Date: Jan 2012
Location: Moldova, Chisinau
Old 09-05-2013 , 13:11   Re: [HELP] Chat money
Reply With Quote #6

Thanks guys, but I want to prin money in freezetime (on spawn) cause I use plugin for gather
faKe91 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 17:18.


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