Thread: [Help] Error
View Single Post
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 10-15-2015 , 14:19   Re: [Help] Error
Reply With Quote #8

E.G. don't rely too much on this code, i wrote this quickly.
This is just an example, your gonna have to work with it to get what you want.

Code:
StringMap HashMap;

public void OnPluginStart() {
	HashMap = new StringMap();
}

//some method to call kv
Handle kv = CreateKeyValues("mykeyvalues");
char sIndex[8], sURL[64];
do {
	kv.GetSectionName(sIndex, sizoef(sIndex));
	kv.GetString("url", sURL, sizeof(sURL));
	HashMap.SetString(sIndex, url, false);
} while kv.GotoNextKey();

//To extract
char sIndex[8], sURL[64];
temp = g_iUserLookingIndex[client];
Format(sIndex, sizeof(sIndex), "%d", temp);
HashMap.GetString(sIndex, sURL, sizeof(sURL));
//do whatever with the url
__________________
Chaosxk is offline