Raised This Month: $12 Target: $400
 3% 

Printing list with team colors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Estland
Member
Join Date: Nov 2012
Old 05-29-2015 , 10:04   Printing list with team colors
Reply With Quote #1

Hello, I've a code what prints out a list of different admin types. How can I print it with team colors, so if admin is Terrorist then he/she is red and if admin is CT then he/she is blue (spectator/unassigned is gray). And comma would be default.
Example:
* Admins: Player1, Player2, Player3
Part of code:
Code:
    else  
    {  
        new aonline[200]  
        new aname[32], iAdminID  
        for(new z=0 ; z<aCounter ; z++)  
        {  
            iAdminID = Admin[z]  
            get_user_name(iAdminID, aname, 31)  
            add(aonline, charsmax(aonline), aname)  
            
            if (z != aCounter-1)  
            {  
                add(aonline, charsmax(aonline), ", ")  
            }  
        } 
        ColorChat(id, NORMAL, "^4*^1 Adminid: ^3%s^1.", aonline)
    }
Estland is offline
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 05-29-2015 , 12:44   Re: Printing list with team colors
Reply With Quote #2

^x03 will be the same color corresponding to the seeing players team.
Which means you cannot achieve what you are trying to do.

Last edited by nnajko; 05-30-2015 at 10:49. Reason: wickedd's comment
nnajko is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-29-2015 , 17:28   Re: Printing list with team colors
Reply With Quote #3

Quote:
Originally Posted by nnajko View Post
^x03 will be the same color corresponding to the seeing players team.
Which means you cannot achieve what you are asking for.
You meant to he can achieve what he's trying to do.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-30-2015 , 20:50   Re: Printing list with team colors
Reply With Quote #4

Quote:
Originally Posted by wickedd View Post
You meant to he can achieve what he's trying to do.
no he can't

team colors (red blue grey) can only be shown for players in the same team (as far as I know)
that means you can't have all 3 colors in one message, but only the color corresponding to the team you are in

he's trying to make the colors based on the admins' teams, not on the player who requests the list's team
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-30-2015 , 23:34   Re: Printing list with team colors
Reply With Quote #5

Only if each admin name is a separate chat message - not in the same line.
__________________

Last edited by claudiuhks; 05-30-2015 at 23:34.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-31-2015 , 02:38   Re: Printing list with team colors
Reply With Quote #6

Quote:
Originally Posted by aron9forever View Post
no he can't

team colors (red blue grey) can only be shown for players in the same team (as far as I know)
You're wrong, he can show team colors to any team.
Quote:
Originally Posted by aron9forever View Post
that means you can't have all 3 colors in one message, but only the color corresponding to the team you are in
You can't use red, blue or grey together in the same chat message period.

Quote:
Originally Posted by aron9forever View Post
he's trying to make the colors based on the admins' teams, not on the player who requests the list's team
If I understand you right, it's possible.

Quote:
Originally Posted by claudiuhks View Post
Only if each admin name is a separate chat message - not in the same line.
That's what I was thinking, then he can show any team color he wants.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-31-2015 , 06:37   Re: Printing list with team colors
Reply With Quote #7

Quote:
Originally Posted by wickedd View Post
That's what I was thinking, then he can show any team color he wants.
Exactly. So aron9forever, you must understand first how SayText works.

PHP Code:
new receivingPlr// player that receives the message
new sendingPlr// player that sends the message

message_begin(MSG_ONEget_user_msgid("SayText"), _receivingPlr); // starts SayText message for receivingPlr player
write_byte(sendingPlr); // sendingPlr's team color will be used after \x03
// Hack - Use get_maxplayers() + 1 instead, to automatically use grey, even if there are no spectators on the server
write_string("\x04[GREEN]\x01[DEFAULT]\x03[TEAM]");
message_end(); 
If sendingPlr's team is Spectator, then receivingPlr sees the [TEAM] grey.
__________________

Last edited by claudiuhks; 05-31-2015 at 06:45.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 05:03.


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