Raised This Month: $ Target: $400
 0% 

StringTable Dumper


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 10-30-2014 , 20:51   StringTable Dumper
Reply With Quote #1

I've found myself needing to analyze the stringtables a few times, so I wrote a stringtable dumper each time. I realized that this was pretty dumb to keep rewriting it so here it is. Mostly for myself for future reference, but feel free to use it for whatever.

PHP Code:
#include <sourcemod>
#include <sdktools>

public OnMapStart() {
    new 
Handle:file OpenFile("stringtables.txt""w");
    new 
num GetNumStringTables();
    
decl String:name[32], String:str[256];
    for(new 
0numi++) {
        
GetStringTableName(inamesizeof(name));
        new 
size GetStringTableNumStrings(i);
        
WriteFileLine(file"[%d] %s [%d/%d]"inamesizeGetStringTableMaxStrings(i));
        for(new 
0sizej++) {
            
ReadStringTable(ijstrsizeof(str));
            
WriteFileLine(file"\t[%d] %s"jstr);
            
            new 
length GetStringTableDataLength(ij);
            if(
length 0) {
                
decl String:data[length 1];
                
GetStringTableData(ijdatalength 1);
                
WriteFileLine(file"\t\t%s"data);
            }
        }
    }
    
    
CloseHandle(file);

__________________
Dr. McKay is offline
 


Thread Tools
Display Modes

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 22:11.


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