Raised This Month: $ Target: $400
 0% 

Color stock.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-18-2013 , 13:09   Color stock.
Reply With Quote #1

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(); 
            } 
        } 
    } 

Unkolix is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 04-18-2013 , 13:55   Re: Color stock.
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=183388
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-18-2013 , 14:03   Re: Color stock.
Reply With Quote #3

Quote:
Originally Posted by naven View Post
Quote:
!g, !t and !n
... I need blue and red colors... I don't need team, I need separate!
Unkolix is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-18-2013 , 15:01   Re: Color stock.
Reply With Quote #4

That's what the 2nd parameter in client_print_color() is for - you choose what the team colour will be.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-19-2013 , 05:21   Re: Color stock.
Reply With Quote #5

Quote:
Originally Posted by hornet View Post
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...

I want them no mather what team you are in.
Unkolix is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-19-2013 , 06:16   Re: Color stock.
Reply With Quote #6

Quote:
Originally Posted by Unkolix View Post
!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...

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.
.Dare Devil. is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-19-2013 , 06:40   Re: Color stock.
Reply With Quote #7

Quote:
Originally Posted by Unkolix View Post
!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...

I want them no mather what team you are in.
I just gave you the answer ... read my post again.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-19-2013 , 08:15   Re: Color stock.
Reply With Quote #8

Sorry, I don't understand what do you mean...
Unkolix is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-19-2013 , 08:24   Re: Color stock.
Reply With Quote #9

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" );
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-19-2013 , 08:27   Re: Color stock.
Reply With Quote #10

Quote:
Originally Posted by hornet View Post
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...
Unkolix 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 10:48.


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