Cod team chams using counts

wurzil

New member
Cod Opengl team chams using counts.

Germans
Code:
bool FindGermans(GLsizei count)
{        
    if(count == 6702 || count == 4482 || count == 3078 || count == 1902 ||
       count == 8892 || count == 6672 || count == 2928 || count == 1908 ||
       count == 6186 || count == 3966 || count == 2562 || count == 1386 ||
       count == 3306 || count == 1182 || count == 8502 || count == 1572 ||
       count == 4914 || count == 2694 || count == 1110 || count == 642  ||
       count == 3306 || count == 1182 || count == 3078 || count == 6606 ||
       count == 4158 || count == 1578 || count == 4158 || count == 6378 ||
       count == 2754 || count == 1650 || count == 1080 || count == 8892 ||
       count == 8310 || count == 6090 || count == 2562 || count == 2928 ||
       count == 5298 || count == 1644 || count == 510  || count == 1080 ||
       count == 8310 || count == 6090 || count == 2562 || count == 1458 ||
       count == 7932 || count == 5712 || count == 2184 || count == 6606 ||
       count == 3078 || count == 1974 || count == 6282 || count == 1650 ||
       count == 3588 || count == 1644 || count == 1008 || count == 3114 ||
       count == 990  || count == 1572 || count == 4722 || count == 2502 ||
       count == 918  || count == 450  || count == 2790 || count == 570  ||
       count == 8700 || count == 6480 || count == 2736 || count == 1716)
       {
           return(true);
       }
    return(false);
}
Russians
Code:
bool FindRussians(GLsizei count)
{    
    if(count == 8352 || count == 6132 || count == 2310 || count == 522 ||
       count == 8340 || count == 6120 || count == 1986 || count == 972 ||
       count == 3996 || count == 1458 || count == 888 || count == 678)
       {
           return(true);
       }
    return(false);
}
British
Code:
bool FindBritish(GLsizei count)
{    
    if(count == 5268 || count == 1590 || count == 486  || count == 5100 ||
       count == 1572 || count == 7320 || count == 5100 || count == 1572 ||
       count == 522  || count == 7488 || count == 5268 || count == 1590 || 
       count == 486  || count == 7062 || count == 4842 || count == 432)
       {
           return(true);
       }
    return(false);
}
Americans
Code:
bool FindAmericans(GLsizei count)
{    
    if(count == 516  || count == 2640 || count == 852  || count == 426  ||
       count == 2820 || count == 1032 || count == 606  || count == 426  ||
       count == 6642 || count == 4422 || count == 2028 || count == 1482 ||
       count == 6552 || count == 4332 || count == 1938 || count == 1392 ||
       count == 2442 || count == 852  || count == 6498 || count == 3594 ||
       count == 5412 || count == 3192 || count == 798  || count == 3030 ||
       count == 1440 || count == 1014 || count == 3690 || count == 3504 ||
       count == 1716 || count == 1290 || count == 6696 || count == 4476 ||
       count == 2082 || count == 1536 || count == 1296 || count == 708  ||
       count == 3006 || count == 1218 || count == 792  || count == 1884 ||
       count == 1338 || count == 1296 || count == 708  || count == 1098 ||
       count == 510  || count == 84   || count == 720  || count == 3138 ||
       count == 1350 || count == 924  || count == 3708 || count == 1110 ||
       count == 606  || count == 684  || count == 4074 || count == 1476 ||
       count == 972 || count == 606)
       {
           return(true);
       }
    return(false);
}
Chams cleanup
Code:
void ChamsFixes(GLenum mode, GLsizei count, const GLvoid *indices)
{
    if(count == 810  || count == 576  || count == 2682 || count == 2220 ||
       count == 462  || count == 432  || count == 2124 || count == 1272 ||
       count == 588  || count == 318  || count == 324  || count == 114  ||
       count == 420  || count == 270  || count == 690  || count == 450  ||
       count == 606  || count == 180  || count == 210  || count == 1380 ||
       count == 348  || count == 336  || count == 366  || count == 216  ||
       count == 354  || count == 966  || count == 168  || count == 234  ||
       count == 560  || count == 948  || count == 7824 || count == 132  ||
       count == 138  || count == 144  || count == 378  || count == 960  ||
       count == 1104 || count == 360  || count == 1656 || count == 4134 ||
       count == 4134 || count == 4134 || count == 3672 || count == 414  ||
       count == 384  || count == 150  || count == 372  || count == 3672 ||
       count == 4134 || count == 2109 || count == 5757)
       {
           glEnable(GL_DEPTH_TEST);
       }    
       if(indices==NULL)
       {
       glColor4f(0.65f,0.65f,0.65f,1.5f);       
       glEnable(GL_DEPTH_TEST);;
       }
       if(mode == GL_QUADS)
       {
           glColor4f(0.65f,0.65f,0.85f,0.65f);
       glEnable(GL_DEPTH_TEST);    
       }
}
Example usage in glDrawElements

Make sure the redraw line matches your glDrawElements or it will crash.
*example in sinner's etx base it would be "o_glDrawElements"

Code:
    glEnable(GL_DEPTH_TEST);
    glDisable(GL_FOG);

    ChamsFixes(mode, count, indices);
   
    if(mode!=GL_QUADS && indices)
    {
        if(FindGermans(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();

 glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);     
                     glEnable(GL_COLOR_MATERIAL);                                          
                 glColor4f(1.0f,0.0f, 0.0f,1.0f);
                             glDisable(GL_COLOR_MATERIAL);
                        glDrawElements(mode, count, type, indices);                           
                     glEnable(GL_COLOR_MATERIAL);
                     glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
                     glDisable(GL_COLOR_MATERIAL);
                     glEnable(GL_DEPTH_TEST);    
                 glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
                    glPopMatrix();
                     
        }    
    if(FindRussians(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();            
                 glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);
                     glEnable(GL_COLOR_MATERIAL);                                          
                 glColor4f(1.0f,1.0f, 0.0f,1.0f);
                     glDisable(GL_COLOR_MATERIAL);
                        glDrawElements(mode, count, type, indices);                           
                     glEnable(GL_COLOR_MATERIAL);
                     glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
                     glDisable(GL_COLOR_MATERIAL);
                     glEnable(GL_DEPTH_TEST);
                 glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
                    glPopMatrix();
        }    
    if(FindBritish(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();    
                         glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);   
                     glEnable(GL_COLOR_MATERIAL);                                          
                 glColor4f(0.0f,1.0f, 1.0f,1.0f);
                         glDisable(GL_COLOR_MATERIAL);
                        glDrawElements(mode, count, type, indices);                           
                     glEnable(GL_COLOR_MATERIAL);
                     glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
                     glDisable(GL_COLOR_MATERIAL);
                     glEnable(GL_DEPTH_TEST);
                 glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
                    glPopMatrix();
        }    
    if(FindAmericans(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();         
                 glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);
                     glEnable(GL_COLOR_MATERIAL);                                          
                 glColor4f(0.0f,1.0f, 0.0f,1.0f);
                     glDisable(GL_COLOR_MATERIAL);
                        glDrawElements(mode, count, type, indices);                           
                     glEnable(GL_COLOR_MATERIAL);
                     glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
                     glDisable(GL_COLOR_MATERIAL);
                     glEnable(GL_DEPTH_TEST);
                 glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
                    glPopMatrix();
        }    
    }
End result

endresult.jpg
 

WannaBe

New member
I got some probs tho..(sorry for double post)

take alook at the screenies

my code =(BTW this is sycore source)

Code:
void APIENTRY moose_glDrawElements(GLenum mode,  GLsizei count, GLenum type, const GLvoid *indices)
{
        (glDrawElements)(mode, count, type, indices);
    
            ChamsFixes(mode, count, indices);
   
    if(mode!=GL_QUADS && indices)
    {
        if(FindGermans(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);     
            glEnable(GL_COLOR_MATERIAL);                                          
            glColor4f(1.0f,0.0f, 0.0f,1.0f);
            glDisable(GL_COLOR_MATERIAL);
            glDrawElements(mode, count, type, indices);                           
            glEnable(GL_COLOR_MATERIAL);
            glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
            glDisable(GL_COLOR_MATERIAL);
            glEnable(GL_DEPTH_TEST);    
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
            glPopMatrix();


            if(FindRussians(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();            
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);
            glEnable(GL_COLOR_MATERIAL);                                          
            glColor4f(1.0f,1.0f, 0.0f,1.0f);   
            glDisable(GL_COLOR_MATERIAL);
            glDrawElements(mode, count, type, indices);                           
            glEnable(GL_COLOR_MATERIAL);
            glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
            glDisable(GL_COLOR_MATERIAL);
            glEnable(GL_DEPTH_TEST);
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
            glPopMatrix();
        }    
    
         if(FindBritish(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();    
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);   
           glEnable(GL_COLOR_MATERIAL);                                          
            glColor4f(1.0f,1.0f, 0.0f,1.0f);   
            glDisable(GL_COLOR_MATERIAL);
            glDrawElements(mode, count, type, indices);                           
            glEnable(GL_COLOR_MATERIAL);
            glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
            glDisable(GL_COLOR_MATERIAL);
            glEnable(GL_DEPTH_TEST);
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
            glPopMatrix();
        }   

            if(FindAmericans(count)==true)
        {
            glDisable(GL_DEPTH_TEST);
            glPushMatrix();         
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_BLEND);
            glEnable(GL_COLOR_MATERIAL);                                          
            glColor4f(1.0f,1.0f, 0.0f,1.0f);   
            glDisable(GL_COLOR_MATERIAL);
            glDrawElements(mode, count, type, indices);                           
            glEnable(GL_COLOR_MATERIAL);
            glColor4f(0.6f, 0.6f, 0.6f, 0.6f);
            glDisable(GL_COLOR_MATERIAL);;
            glEnable(GL_DEPTH_TEST);
            glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
            glPopMatrix();
                   }    
    }
ok the probs are, the chams on each other team are the same and every here and there some of te germans turn yellow, and every here and there ever turns green from red the goes back to red


EDIT::::::
i edit the void chamsfix t this now i only get AXIS chams( they turn out proper enough for me. but i have no allied chams

Code:
void ChamsFixes(GLenum mode, GLsizei count, const GLvoid *indices)
{
    if(count == 810  || count == 576  || count == 2682 || count == 2220 ||
       count == 462  || count == 432  || count == 2124 || count == 1272 ||
       count == 588  || count == 318  || count == 324  || count == 114  ||
       count == 420  || count == 270  || count == 690  || count == 450  ||
       count == 606  || count == 180  || count == 210  || count == 1380 ||
       count == 348  || count == 336  || count == 366  || count == 216  ||
       count == 354  || count == 966  || count == 168  || count == 234  ||
       count == 560  || count == 948  || count == 7824 || count == 132  ||
       count == 138  || count == 144  || count == 378  || count == 960  ||
       count == 1104 || count == 360  || count == 1656 || count == 4134 ||
       count == 4134 || count == 4134 || count == 3672 || count == 414  ||
       count == 384  || count == 150  || count == 372  || count == 3672 ||
       count == 4134 || count == 2109 || count == 5757)
       {
    
           glEnable(GL_DEPTH_TEST);
    }    
        
}
http://www.xfire.com/profile/
the top SS with red chams is the bot i am working on
 

Attachments

  • shot0000.jpg
    shot0000.jpg
    112.5 KB · Views: 97

wurzil

New member
First thing I noticed is your returning your function before calling the hax,
this line should be at bottom of glDrawElements after all the hack code,
(glDrawElements)(mode, count, type, indices);

Also the redraw calls should match your function atm they are as I left them glDrawElements(mode, count, type, indices);
and they should look like (glDrawElements)(mode, count, type, indices);
Its mix and matched code causing your problems I expect.

Some counts are shared between models, at different distances etc.

Ill pm you my msn , and Ill help you get it going in sinners hook.
 

MacTrainerGuy

New member
Re: Keep up this great resource pls.

Sorry to re-awaken a very old thread. But how exactly did you find the counts to use as you did above? Did you just hook it with a function to log all queries to file? If so, how did you know which was a player and which was a random object? I'm stuck with a game that doesn't use glBegin, I think it does the advanced stuff with glDrawArrays. Any help would be greatly appreciated!
 

BraveBeast

Super Moderator
Re: Keep up this great resource pls.

Sorry to re-awaken a very old thread. But how exactly did you find the counts to use as you did above? Did you just hook it with a function to log all queries to file? If so, how did you know which was a player and which was a random object? I'm stuck with a game that doesn't use glBegin, I think it does the advanced stuff with glDrawArrays. Any help would be greatly appreciated!
He left in 2007 so your only hope is for someone else to answer your question.
 
Top