Simple code that I just put together.

Took me sometime to get the textures right (VMT files are weird) so I decided to upload them to this thread to make it easier to anyone that wants to do something with them.

Code:

int g_vRankTextures[19];

//Texture files. Make sure they are on the right folder.
// The texture should be inside steamapps\common\Counter-Strike Global Offensive\csgo\materials\ranks
// If you change the texture location you must change each .vmt file.
std::map g_vRankFiles = {
{ 0, "white" },
{ 1, "ranks/silver-1" },
{ 2, "ranks/silver-2" },
{ 3, "ranks/silver-3" },
{ 4, "ranks/silver-4" },
{ 5, "ranks/silver-5" },
{ 6, "ranks/sem" },
{ 7, "ranks/gold-1" },
{ 8, "ranks/gold-2" },
{ 9, "ranks/gold-3" },
{ 10, "ranks/gold-master" },
{ 11, "ranks/master-guardian-1" },
{ 12, "ranks/master-guardian-2" },
{ 13, "ranks/mge" },
{ 14, "ranks/dmg" },
{ 15, "ranks/legendary-eagle" },
{ 16, "ranks/lem" },
{ 17, "ranks/smfc" },
{ 18, "ranks/global" }
};

void DrawTexturedRect( int textureId, int x, int y, int w, int h ) {
int x0 = x;
int x1 = x0 + w;
int y0 = y;
int y1 = y0 + h;
SDK::Interfaces::g_pVGuiSurface->DrawSetTexture( textureId );
SDK::Interfaces::g_pVGuiSurface->DrawTexturedRect( x0, y0, x1, y1 );
}

//Somewhere during initialization

//Load textures
for( int i = 0; i < g_vRankFiles.size(); i++ ) {
int _w, _h;
g_vRankTextures[i] = SDK::Interfaces::g_pVGuiSurface->CreateNewTextureID( false );
SDK::Interfaces::g_pVGuiSurface->DrawSetTextureFile( g_vRankTextures[i], g_vRankFiles.at(i).c_str(), true, true );
SDK::Interfaces::g_pVGuiSurface->DrawGetTextureSize( g_vRankTextures[i], _w, _h );
SDK::Interfaces::g_pVGuiSurface->DrawSetTextureRGBA( g_vRankTextures[i], SDK::Color::White( 255 ), _w, _h );
}


//Inside your drawing function
int h = 40;
int w = 72;
for( int i = 0; i < 19; i++ ) {
DrawTexturedRect( g_vRankTextures[i], 20, i*h, w, h );
}

Result:

[Source] Drawing Competitive Rank textures in Counterstrike Global Offensive

Texture files: (Place them inside the csgo folder)
http://www.unknowncheats.me/forum/do=file&id=14970


Original Writen by MarkHC in Counterstrike Global Offensive Category, the date of 23-06-2015 04:22.