Raised This Month: $ Target: $400
 0% 

[CSGO] Get map brush model path


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EmeraldGhost
Junior Member
Join Date: Oct 2015
Old 01-31-2021 , 08:29   [CSGO] Get map brush model path
Reply With Quote #1

Hi all, is there a method to get map brush model info?
I'm trying to get all models used by a map. But I can only get prop_xxxx's model using the code below:
Code:
    // 0=worldspawn, skip
    for (int i=1; i<=GetEntityCount(); i++)
    {
        // invalid entity
        if (!IsValidEntity(i))
            continue;

        // Ent has this property
        if (HasEntProp(i, Prop_Data, "m_ModelName"))
        {
            // Success?
            if (GetEntPropString(i, Prop_Data, "m_ModelName", sName, sizeof(sName)))
            {
                // modelname is ptr?
                if (sName[0] == '*' && (hModelTable != INVALID_STRING_TABLE))
                {
                    // Process stringtable
                    ReplaceString(sName, sizeof(sName), "*", "", false);
                    int iTableIdx = StringToInt(sName);
                    ReadStringTable(hModelTable, iTableIdx, sName, sizeof(sName));
                }
                PrintToServer("m_ModelName -> %s", sName);
            }
        }
    }
How ever, I still got "*xx" in modelprecache StringTables. When I dumped the whole modelprecache table I got these:
Quote:
maps/de_elysion.bsp
*1
*2
*3
*4
*5
*6
*7
*8
*9
*10
*11
*12
*13
*14
*15
*16
*17
*18
*19
*20
*21
So.. Is there a method can let me reach the model path by this pattern looks like ptr?
Thank you for helping.
__________________
aka. EmeraldGhost / eeeeeG ^^
EmeraldGhost is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode