Code:
const char* pszModelName = pBaseEntity->GetModelName();
if (streql(pszModelName,"models/items/medkit_small.mdl") || streql(pszModelName,"models/items/medkit_small_bday.mdl") || streql(pszModelName,"models/props_halloween/halloween_medkit_small.mdl") )
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Pill" );
}
if (streql(pszModelName,"models/items/ammopack_small.mdl") || streql(pszModelName,"models/items/ammopack_small_bday.mdl") )
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Ammo" );
}
if (streql(pszModelName,"models/items/medkit_medium.mdl") || streql(pszModelName,"models/items/medkit_medium_bday.mdl") || streql(pszModelName,"models/props_halloween/halloween_medkit_medium.mdl"))
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Medkit" );
}
if (streql(pszModelName,"models/items/ammopack_medium.mdl") || streql(pszModelName,"models/items/ammopack_medium_bday.mdl"))
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Ammo Pack" );
}
if (streql(pszModelName,"models/items/medkit_large.mdl") || streql(pszModelName,"models/items/medkit_large_bday.mdl") || streql(pszModelName,"models/props_halloween/halloween_medkit_large.mdl"))
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Full Medkit" );
}
if (streql(pszModelName,"models/items/ammopack_large.mdl") || streql(pszModelName,"models/items/ammopack_large_bday.mdl"))
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Full Ammo Pack" );
}
if (streql(pszModelName,"models/items/tf_gift.mdl") || streql(pszModelName,"models/props_halloween/halloween_gift.mdl"))
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Gift" );
}
if (streql(pszModelName,"models/items/plate.mdl") || streql(pszModelName,"models/items/plate_steak.mdl") || streql(pszModelName,"models/items/plate_robo_sandwich.mdl"))
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Sandwich" );
}
if (streql(pszModelName,"models/items/currencypack_small.mdl") || streql(pszModelName,"models/items/currencypack_medium.mdl") || streql(pszModelName,"models/items/currencypack_large.mdl"))
{
gDrawManager.DrawString( false, vScreen.x, vScreen.y, dwTeamColor ,"Money" );
}Code:
DWORD* GetModel( )
{
PVOID pRenderable = (PVOID)(this + 0x4);
typedef DWORD* ( __thiscall* OriginalFn )( PVOID );
return getvfunc<OriginalFn>( pRenderable, 9 )( pRenderable );
}
const char* GetModelName()
{
return g_pModelInfo->GetModelName(this->GetModel());
}Code:
class IVModelInfo
{
public:
const char* GetModelName( DWORD* model )
{
typedef const char* ( __thiscall* OriginalFn )( PVOID, DWORD* );
return getvfunc<OriginalFn>( this, 3 )( this, model );
}
};
extern IVModelInfo* g_pModelInfo;Code:
if( !g_pModelInfo )
{
g_pModelInfo = ( IVModelInfo* ) g_pEngineFactory( "VModelInfoClient006", NULL );
gBaseAPI.LogToFile( "g_pModelInfo: [0x%.8X]", (DWORD)g_pModelInfo );
XASSERT( g_pModelInfo );
}
Aucun commentaire:
Enregistrer un commentaire