BZComplexForumGalleryBug TrackerWikiBlog
* Login  * FAQ    * Search
It is currently Wed Jan 20, 2021 3:40 am

View unanswered posts | View active topics


Board index » Battlezone » Mods and Maps

All times are UTC


DLL Snipit: Client Side Team Colors



Post new topic Reply to topic  Page 1 of 1
 [ 1 post ] 
  Print view Previous topic | Next topic 
Author Message
Nielk1
 Post subject: DLL Snipit: Client Side Team Colors
PostPosted: Wed Oct 08, 2008 10:20 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 25, 2007 8:58 am
Posts: 300
Location: New Jersey, USA
Gender: Male
WordPress Blog: Visit User's Blog
Header
Code:
int COLORS_RED   = {0, 255,   0, 255, 255,   0, 255, 255, 0}; // gan'na ignore [0] to mean default
int COLORS_GREEN = {0,   0,   0,   0, 255, 255,   0, 255, 0}; // gan'na ignore [0] to mean default
int COLORS_BLUE  = {0,   0, 255,   0,   0, 255, 255, 255, 0}; // gan'na ignore [0] to mean default
int NUM_COLORS = 9 // counting default (fake set of 0s at front)


Function of choice, execute would allow contiunous rechecking incase of in game change.
Code:
int teamColorA = GetCVarItemInt(GetLocalPlayerTeamNumber(),70); // civar 70
int teamColorB = GetCVarItemInt(GetLocalPlayerTeamNumber(),71); // civar 71

if((teamColorA > NUM_COLORS) || (teamColorA < 0)){teamColorA = 0;} //sanity check
if((teamColorB > NUM_COLORS) || (teamColorB < 0)){teamColorB = 0;} //sanity check

if(teamColorA || teamColorB)
{
   for(i=0;i<MAX_TEAMS;i++)
   {
      int teamGroup = WhichTeamGroup(i); // confirm what values come out of this for below
      if (teamGroup == 0)
      {
         if (teamColorA != 0)
         {
            SetTeamColor(i, COLORS_RED[teamColorA], COLORS_GREEN[teamColorA], COLORS_BLUE[teamColorA]);
         }else{
            SetTeamColor(i, 255, 0, 0); // force default red
         }
      }
      if (teamGroup == 1)
      {
         if (teamColorB != 0)
         {
            SetTeamColor(i, COLORS_RED[teamColorB], COLORS_GREEN[teamColorB], COLORS_BLUE[teamColorB]);
         }else{
            SetTeamColor(i, 0, 0, 255); // force default blue
         }
      }
   }
}

_________________
"Failure isn't an option. It comes bundled with your Microsoft product."


Top
  ProfileYIMICQ 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 1 post ] 

Board index » Battlezone » Mods and Maps

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
      Powered by MediaWiki