AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Color stock. (https://forums.alliedmods.net/showthread.php?t=213757)

Unkolix 04-18-2013 13:09

Color stock.
 
I need to get red and blue colors, can't find out how.
PHP Code:

stock client_print_color(const id, const input[], any:...) 

    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 

    
replace_all(msg190"!g""^x04"); // Green Color 
    
replace_all(msg190"!n""^x01"); // Default Color 
    
replace_all(msg190"!t""^x03"); // Team Color 

    
if (idplayers[0] = id; else get_players(playerscount"ch"); 
    { 
        for (new 
0counti++) 
        { 
            if (
is_user_connected(players[i])) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 



naven 04-18-2013 13:55

Re: Color stock.
 
http://forums.alliedmods.net/showthread.php?t=183388

Unkolix 04-18-2013 14:03

Re: Color stock.
 
Quote:

Originally Posted by naven (Post 1935230)

Quote:

!g, !t and !n
... I need blue and red colors... I don't need team, I need separate!

hornet 04-18-2013 15:01

Re: Color stock.
 
That's what the 2nd parameter in client_print_color() is for - you choose what the team colour will be.

Unkolix 04-19-2013 05:21

Re: Color stock.
 
Quote:

Originally Posted by hornet (Post 1935285)
That's what the 2nd parameter in client_print_color() is for - you choose what the team colour will be.

!t - team color, if you are terrorist, it will be red, if you are ct, it will be blue, if spec it will be grey... :shock:

I want them no mather what team you are in.

.Dare Devil. 04-19-2013 06:16

Re: Color stock.
 
Quote:

Originally Posted by Unkolix (Post 1935616)
!t - team color, if you are terrorist, it will be red, if you are ct, it will be blue, if spec it will be grey... :shock:

I want them no mather what team you are in.

before you call this color stock, set player for example to terrorist team if you want read
then skip one frame, call color stock, skip one frame and then set him back his old team.

what i mean by skiping frame is for example

public something()
set_player_team
set_task( 0.1, "color_stock" )

public color_stock()
color_stock_call
set_task( 0.1, "back_to_old_team" )

public back_to_old_team()
set_player_team(oldteam)

set task is too slow for that, client_prethink is fine.

hornet 04-19-2013 06:40

Re: Color stock.
 
Quote:

Originally Posted by Unkolix (Post 1935616)
!t - team color, if you are terrorist, it will be red, if you are ct, it will be blue, if spec it will be grey... :shock:

I want them no mather what team you are in.

I just gave you the answer ... read my post again.

Unkolix 04-19-2013 08:15

Re: Color stock.
 
Sorry, I don't understand what do you mean...

hornet 04-19-2013 08:24

Re: Color stock.
 
Take a look at the link naven gave you.

Connors ColorChat plugin has what your asking for.

Eg. If I want to see a red message no matter what team I'm on, I'm going to put:
Code:

client_print_color( id, Red, "!tThis is a RED message" );
And then I can still do:
Code:

client_print_color( id, Red, "!gGreen !nYellow !tRed" );

Unkolix 04-19-2013 08:27

Re: Color stock.
 
Quote:

Originally Posted by hornet (Post 1935717)
Take a look at the link naven gave you.

Connors ColorChat plugin has what your asking for.

Eg. If I want to see a red message no matter what team I'm on, I'm going to put:
Code:

client_print_color( id, Red, "!tThis is a RED message" );
And then I can still do:
Code:

client_print_color( id, Red, "!gGreen !nYellow !tRed" );

I need to install the plugin, which I don't want to...


All times are GMT -4. The time now is 10:47.

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