Quote:
Originally Posted by Razmo51
and how to do that ?
sorry, but I'm a noob in array
|
Use a trie. Its faster and easy to use.
Code:
new Handle:g_trie;//global trie
public OnPluginStart()
{
g_trie = CreateTrie();//Create
SetTrieValue(g_trie, "Smoke", 5000); //Store the values
SetTrieValue(g_trie, "Flash", 6000);
SetTrieValue(g_trie, "Godmode", 8000);
}
public OnPluginEnd()
{
CloseHandle(g_trie);//Make sure to close the trie.
}
MyRandomFunction()
{
//Grab the Smoke value.
new value;
if(GetTrieValue(g_trie, "Smoke", value))
{
PrintToServer("The value for smoke is %i", value);
}
else
{
PrintToServer("Failed to get the value for smoke from the trie");
}
}