Raised This Month: $ Target: $400
 0% 

Help With Keyvalues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klashfire
Member
Join Date: May 2014
Location: NY, USA
Old 04-17-2016 , 13:46   Help With Keyvalues
Reply With Quote #1

I'm getting the hang of it, but I am a bit confused with the terminology and would like some help with it.

First off why does
PHP Code:
if ( KvJumpToKeyDBSIDtrue ) ) {
    
//some code here

work? This was taken from a tutorial, but I am a bit confused on how this works. From what I know, KvJumpToKey() isn't a boolean - it is a function. There is no truth value, so how would this statement execute?

Secondly - how would I search for a specific string within a file containing several trees? Would this work on a for loop? Let me elaborate:
PHP Code:
KvGetString(DB"name"temp_namesizeof(temp_name), "NULL"); 
would find the "name" string within our KvJumpToKey() within the DB handle, declared before.

How would I search every tree within DB to find a string within them?
Say, we wanted the string corresponding to the "command" placement within a txt file.
this "command" is within each one of the several trees in our database. each tree has a different name, so I wouldn't be able to increment by 1 or something.

I need the "command" from

"random name"
{
"value1" "user entered value"
"command" "clients value"
}

and from

"other name"
{
"value1" "user entered value"
"command" "clients value"
}

as well as

"random letters here"
{
"value1" "user entered value"
"command" "clients value"
}
etc.
__________________


Last edited by klashfire; 04-17-2016 at 13:47.
klashfire is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 04-17-2016 , 13:58   Re: Help With Keyvalues
Reply With Quote #2

Lil answer to first question:

It is boolean function i guess
Depending on arguments you provided this function with the result will be either true or false
In this caase it will be true if the key exists, false if it does not and was not created.

Whenever you're in doubt always check out api i guess
https://sm.alliedmods.net/new-api/keyvalues/KvJumpToKey
__________________
...

Last edited by Oshizu; 04-17-2016 at 14:01.
Oshizu is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode