Thread: Keyvalues
View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-06-2012 , 12:05   Re: Keyvalues
Reply With Quote #7

Code:
"Test"
{
    "name" "jesus"
}
Quote:
Originally Posted by Peace-Maker View Post
You need to call KvGotoFirstSubKey first.
KvGotoFirstSubKey without the second argument being set to false will just return false with this structure, as there are no subkeys under the root (only values).

KvGotoFirstSubKey with the second argument being set to false will make
PHP Code:
KvGetString(KV"name"sValsizeof(sVal)); 
return false, as it should since a value doesn't have any values beneath it.

PHP Code:
KvGetString(KVNULL_STRINGsValsizeof(sVal)); 
should work at that point, though.

Still,
PHP Code:
KvGetString(KV"name"sValsizeof(sVal)); 
should work without needing KvGotoFirstSubKey...
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline