Hello, I'm trying to get the value of a key, and I've tried many ways and it still doesn't work... there's no errors in the compilation, but I can't get the name of key, when I do a print chat it doesn't show anything.
here my config file
test.cfg
Code:
"Test"
{
"name" "jesus"
}
function which grabs key value
Code:
public motd(client, target) {
new String:sPath[PLATFORM_MAX_PATH];
BuildPath(Path_SM, sPath, sizeof(sPath), "configs/test.cfg");
new String:sVal[64];
if(!FileExists(sPath)) {
PrintToChat(client, "Error");
return;
}
new Handle:KV = CreateKeyValues("Test");
FileToKeyValues(KV, sPath);
KvGetString(KV, "name", sVal, sizeof(sVa));
PrintToChat(client, "good to go %s", sVal)
Thanks