KeyValues not working
Hey.
I've been building a plugin where it needs to check on client authorized if his steamid is on the file as keyvalues. It is suposed to create one if it doesn't exist. Current code part where I want to create it: PHP Code:
Current tags.cfg content: Code:
"VIPTags" |
Re: KeyValues not working
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.
|
Re: KeyValues not working
Quote:
PHP Code:
|
Re: KeyValues not working
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. |
Re: KeyValues not working
Quote:
|
Re: KeyValues not working
Quote:
PHP Code:
|
Re: KeyValues not working
See the last example on the wiki: https://wiki.alliedmods.net/KeyValue...Value_Creation
You need to use SetString to store values under the steamID key. An empty section does not seem to be exported. You also need to use Rewind before ExportToFile. |
Re: KeyValues not working
Quote:
PHP Code:
|
Re: KeyValues not working
I don't know, works fine for me:
PHP Code:
Code:
"VIPTags" |
Re: KeyValues not working
Quote:
The current source is: PHP Code:
Thanks for your help! |
All times are GMT -4. The time now is 22:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.