Raised This Month: $51 Target: $400
 12% 

KvGotoFirstSubKey problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-14-2010 , 10:06   KvGotoFirstSubKey problem
Reply With Quote #1

Don't know what to do. Tried everything. For some reason KvGotoFirstSubKey always returns "false".
PHP Code:
RemoveOldCache()
{
    new 
currTime GetTime();
    new 
String:szKey[PLATFORM_MAX_PATH];
    
KvRewind(g_hKvCache);
    
    if (!
KvGotoFirstSubKey(g_hKvCache))
    {
        
PrintToServer("EMPTY WHY??????"); // <- this what it always prints
        
return;
    }
    
    do
    {
        
KvGetSectionName(g_hKvCacheszKeysizeof(szKey));
        
PrintToServer("Section Name: %s"szKey);
        if ( (
currTime KvGetNum(g_hKvCacheszKey)) > 10)
        {
            
KvDeleteThis(g_hKvCache);
        }
    } while (
KvGotoNextKey(g_hKvCache));

Dumped kv structure:
Code:
"WhitelistCache"
{
	"materials\sprites\white.vmt"		"1268575491"
	"materials\vgui\white.vmt"		"1268575491"
	"materials\effects\flashbang.vmt"		"1268575491"
	"materials\effects\flashbang_white.vmt"		"1268575491"
	"materials\particle\particle_smokegrenade1.vmt"		"1268575491"
	"materials\sprites\scope_arc.vmt"		"1268575491"
	"models\weapons\w_c4_planted.mdl"		"1268575491"
	"models\player\ct_urban.mdl"		"1268575491"
	"models\player\ct_gsg9.mdl"		"1268575491"
	"models\player\ct_sas.mdl"		"1268575491"
	"models\player\ct_gign.mdl"		"1268575491"
	"models\player\t_phoenix.mdl"		"1268575491"
	"models\player\t_leet.mdl"		"1268575491"
	"models\player\t_arctic.mdl"		"1268575491"
	"models\player\t_guerilla.mdl"		"1268575491"
	"materials\models\player\ct_urban\ct_urban.vmt"		"1268575491"
	"materials\models\player\ct_urban\ct_urban_glass.vmt"		"1268575491"
	"materials\models\player\ct_sas\ct_sas.vmt"		"1268575491"
	"materials\models\player\ct_sas\ct_sas_glass.vmt"		"1268575491"
	"materials\models\player\ct_gsg9\ct_gsg9.vmt"		"1268575491"
	"materials\models\player\ct_gign\ct_gign.vmt"		"1268575491"
	"materials\models\player\ct_gign\ct_gign_glass.vmt"		"1268575491"
	"materials\models\player\t_phoenix\t_phoenix.vmt"		"1268575491"
	"materials\models\player\t_guerilla\t_guerilla.vmt"		"1268575491"
	"materials\models\player\t_leet\t_leet.vmt"		"1268575491"
	"materials\models\player\t_leet\t_leet_glass.vmt"		"1268575491"
	"materials\models\player\t_arctic\t_arctic.vmt"		"1268575491"
	"materials\sprites\dominations\nemesis_red.vmt"		"1268575491"
	"materials\sprites\dominations\nemesis_red.vtf"		"1268575491"
	"materials\sprites\dominations\nemesis_blue.vmt"		"1268575491"
	"materials\sprites\dominations\nemesis_blue.vtf"		"1268575491"
	"materials\sprites\dominations\nemesis_burst.vmt"		"1268575491"
	"materials\sprites\dominations\nemesis_burst.vtf"		"1268575491"
	"sound\dominations\domination.mp3"		"1268575491"
	"sound\dominations\nemesis.mp3"		"1268575491"
	"sound\homer\woohoo.wav"		"1268575491"
	"sound\homer\doh.wav"		"1268575491"
}
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-14-2010 , 11:16   Re: KvGotoFirstSubKey problem
Reply With Quote #2

Nevermind. Had to use KvGotoFirstSubKey(g_hKvCache, false) and KvGotoNextKey(g_hKvCache, false). And then KvRewind(g_hKvCache) before dumping to file.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
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:30.


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