View Single Post
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 05-09-2012 , 09:56   Re: Array Question
Reply With Quote #6

Quote:
Originally Posted by Razmo51 View Post
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");     } }
Dr!fter is offline