Thread: [Solved] KeyValues not working
View Single Post
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 02-24-2021 , 05:04   Re: KeyValues not working
Reply With Quote #6

Quote:
Originally Posted by DJ Tsunami View Post
Yes, although I don't see any reason why JumpToKey would ever return false here, so I think the if statement is unnecessary.

return; at the end of a function is also unnecessary.
Well, it didn't work... I have noticed a error on my code for the kv.JumpToKey. It has only 1 KvGetString and the other two are kvSetString. I have changed that but still doesn't work.

PHP Code:
void CheckForKeyValues(int clientchar[] steamID)
{
    
KeyValues kv = new KeyValues("VIPTags");
    
kv.ImportFromFile(filePath);
    
    
KvGotoFirstSubKey(kv);
    
    if(
kv.JumpToKey(steamIDtrue))
    {
        
KvGetString(kv"scoretag"scoreTag[client], sizeof(scoreTag[]), "NEW SETUP - ");
        
KvGetString(kv"chatcolor"chatColor[client], sizeof(chatColor[]), "{red}");
        
KvGetString(kv"namecolor"nameColor[client], sizeof(nameColor[]), "{blue}");
        
kv.ExportToFile(filePath);
        
delete kv;
        return;
    }
    
    return;

Any idea to fix this?
__________________

Last edited by SpirT; 02-24-2021 at 05:10.
SpirT is offline