Forum

Getting player shirt / pants colors?

Discuss CSQC related programming.

Moderator: InsideQC Admins

Getting player shirt / pants colors?

Postby Dr. Shadowborg » Mon Feb 10, 2014 9:51 pm

I'm working on player quickfrags display for my HUD.

How do I get player shirt / pants colors via CSQC?

Also, how do I determine if a player is present or not?
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Re: Getting player shirt / pants colors?

Postby Dr. Shadowborg » Mon Feb 10, 2014 11:38 pm

Found what I needed:

string = getplayerkeyvalue(-1, "topcolor");
string = getplayerkeyvalue(-1, "bottomcolor");

Above returns color number as used by quake's color cvar from the player currently in the lead.

string = getplayerkeyvalue(-1, "topcolor_rgb");
string = getplayerkeyvalue(-1, "bottomcolor_rgb");

Returns rgb values from the player currently in the lead. Use stov() to convert to a vector.

Also:
string = getplayerkeyvalue(-2, "frags");

Returns frags from runner up player. Returns "" if no runner up, which can be used to determine if there are any other players.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm


Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest