Raised This Month: $ Target: $400
 0% 

Show teammate's money


Post New Thread Reply   
 
Thread Tools Display Modes
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-28-2010 , 12:45   Re: Show teammate's money
Reply With Quote #21

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

#define NAME "show teammate's money"
#define VERSION "1.2.1"
#define AUTHOR "K.K.Lv"


public plugin_init()
{
    
register_plugin(NAMEVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
    
    
register_clcmd("say /money""show_money")
}

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

public 
show_money(client)
{        
    
set_hudmessage(10020000.050.3500.025.00.10.22)
    
show_hudmessage(clientformat_money(cs_get_user_team(client), client))
}

public 
format_money(CsTeams:Teamreq)
{
    new 
team[10], message[480]
    switch(
CsTeams:Team) {
        case 
CS_TEAM_CTteam "CT"
            
case CS_TEAM_Tteam "TERRORIST"        
        
}    
    
    new 
len formatex(messagesizeof message 1"The teammate's money:^n")
    
    new 
players[32], numidname[33]
    
get_players(playersnum"ae"team)
    for(new 
0numi++)
    {
        
id players[i]
    
        if(
id == req)
            continue
    
        
get_user_name(idname32)
        
len += formatex(message[len], sizeof message len"%-22.22s: %d^n"namecs_get_user_money(id))        
    }
    return 
message

__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
roflmao456
Junior Member
Join Date: Jun 2009
Location: Canada
Old 03-28-2010 , 13:10   Re: Show teammate's money
Reply With Quote #22

It would be cool if it will show on the StatusText right after Health when you aim at your team

for example: Friend: Player Health: 100% Money: 800
__________________
roflmao456 is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-28-2010 , 19:34   Re: Show teammate's money
Reply With Quote #23

Quote:
Originally Posted by roflmao456 View Post
It would be cool if it will show on the StatusText right after Health when you aim at your team

for example: Friend: Player Health: 100% Money: 800
will be updated !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-02-2010 , 20:53   Re: Show teammate's money
Reply With Quote #24

There are major errors in this that prevent it from being approved. Here are some of them:

PHP Code:
    for (id 1id g_max_playersid++) 
This will skip the last player if the server is full.

PHP Code:
        if (get_user_team(pid) == 1
Use cs_get_user_team().

PHP Code:
new message[1024
Use static.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approval pending on changes.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 04-02-2010 , 22:13   Re: Show teammate's money
Reply With Quote #25

@Hawk552, fixed !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-02-2010 , 22:15   Re: Show teammate's money
Reply With Quote #26

There are a few mistakes and optimizations that can be made, however it is acceptable.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 04-02-2010 , 22:32   Re: Show teammate's money
Reply With Quote #27

can you point it out !
and I will be fixed it !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-02-2010 , 22:46   Re: Show teammate's money
Reply With Quote #28

Changes have been requested.

PHP Code:
#pragma semicolon 1 
This should be removed from releases.

PHP Code:
sizeof message 
Use charsmax().

PHP Code:
        if (id != client)
        {
            if (
is_user_connected(id))
            {
                if (
cs_get_user_team(id) == cs_get_user_team(client))
                { 
Group these into one if statement to avoid unnecessary jumps.

PHP Code:
    set_hudmessage(10020000.050.3500.025.00.10.22);
    
show_hudmessage(clientmessage); 
Consider using HUD sync objects.

PHP Code:
if (g_teammate[id] == 1
Use boolean logic, i.e.:

PHP Code:
if (g_teammate[id]) 
PHP Code:
public client_disconnect(client)
{
    
remove_task(client);
    return 
PLUGIN_CONTINUE;

Unnecessary return.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 04-16-2010 , 00:52   Re: Show teammate's money
Reply With Quote #29

All have been fixed!
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
La scatola magica
Junior Member
Join Date: Jan 2009
Old 04-20-2012 , 07:33   Re: Show teammate's money
Reply With Quote #30

A client-side solution was also released recently: CSMoneyReporter.
La scatola magica 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 20:54.


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