AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Show teammate's money with color in chat? (https://forums.alliedmods.net/showthread.php?t=170710)

FPcokE 10-28-2011 06:53

Show teammate's money with color in chat?
 
Hey, ive got a "show teammate's money" script working with client_print but i was wondering how to add some color in it too.

The script:
PHP Code:

public show_money(client)
{
    static 
name[32];

    new 
moneyid;
    
    for (
id 1id <= g_max_playersid++)
    {
        if (
is_user_connected(id) && cs_get_user_team(id) == cs_get_user_team(client))
        {
            
money cs_get_user_money(id);
            
get_user_name(idname31);
            
client_print(clientprint_chat"(Penge) %-22.22s: %d^n"namemoney);
        }
    }


Ive searched a bit and i found this:
PHP Code:

    message_begin(MSG_ONEget_user_msgid("SayText"), {0,0,0}, id)
    
write_byte(id)
    
write_string("^x03Team colored text ^x01Normal color")
    
message_end() 

Thats just not exactly what i need (i think) because its not something the player have said in say or say_team.
I want to use team color in the name only, I hope u can help me with this. And is it even possible?

FPcokE 10-28-2011 09:05

Re: Show teammate's money with color in chat?
 
No one? :(

keyblade 10-28-2011 09:41

Re: Show teammate's money with color in chat?
 
colorchat native and stock
http://forums.alliedmods.net/showthr...ight=colorchat

colorchat guide
http://forums.alliedmods.net/showthr...ight=colorchat

next time you should search before post

FPcokE 10-28-2011 10:04

Re: Show teammate's money with color in chat?
 
PHP Code:

            format(msg127"^x01(Penge) ^x03%s^x01: %d^n"namemoney);
            
message_begin(MSG_ONEget_user_msgid("SayText"), {0,0,0}, id);
            
write_byte(id);
            
write_string(msg);
            
message_end(); 

thats it, found out my self. thanks anyway..

FPcokE 10-28-2011 10:40

Re: Show teammate's money with color in chat?
 
PHP Code:

public show_money(client)
{
    static 
name[32];
    static 
msg[128];

    new 
moneyid;
    
    for (
id 1id <= g_max_playersid++)
    {
        if (
is_user_connected(id) && cs_get_user_team(id) == cs_get_user_team(client))
        {            
            
money cs_get_user_money(id);
            
get_user_name(idname31);
            
format(msg127"^x01(Penge) ^x03%s^x01: %d^n"namemoney);

            
message_begin(MSG_ONEget_user_msgid("SayText"), {0,0,0}, id);
            
write_byte(id);
            
write_string(msg);
            
message_end();
        }
    }


Ive got a problem, it only show me X as many players there is in the team instead of showing there name and money :S

PHP Code:

(Penge) [fp]zhe legendary nEwb800
(Penge) [fp]zhe legendary nEwb800 


kblo 11-26-2012 22:59

Re: Show teammate's money with color in chat?
 
well, i was almost happy.

it's really broken. :(

wickedd 11-27-2012 01:07

Re: Show teammate's money with color in chat?
 
@kblo
Why did you revive this thread? Your post is totally useless.


All times are GMT -4. The time now is 14:21.

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