Quote:
Originally Posted by DJ Tsunami
You're passing true to JumpToKey to create the key if it doesn't exist, so naturally it will always return true. Then you need to use ExportToFile to make the key show up in the file.
|
Thanks for the reply DJ Tsunami. Therefore, should it just be like this? :
PHP Code:
{
KeyValues kv = new KeyValues("VIPTags");
kv.ImportFromFile(filePath);
KvGotoFirstSubKey(kv);
if(kv.JumpToKey(steamID, true))
{
PrintToServer("Couldn't find a key for %s but we'll try to create it.", steamID);
KvGetString(kv, "scoretag", scoreTag[client], sizeof(scoreTag[]), "Teste - ");
KvSetString(kv, "chatcolor", chatColor[client], sizeof(chatColor[]), "{red}");
KvSetString(kv, "namecolor", nameColor[client], sizeof(nameColor[]), "{blue}");
kv.ExportToFile(filePath);
delete kv;
return;
}
}
__________________