Getting player shirt / pants colors?

Discuss CSQC related programming.
Post Reply
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Getting player shirt / pants colors?

Post by Dr. Shadowborg »

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?
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Getting player shirt / pants colors?

Post by Dr. Shadowborg »

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.
Post Reply