This is a set of stocks me and Twilight_Suzuka (but mostly her) wrote in order to reproduce the functionality of ArrayX using core AMXX functions. It requires CellTrie (included in
) and CellArray (included in AMXX 1.8.0).
Code:
#include <amxmodx>
#include <amxmisc>
#include <celltravtrie>
public plugin_init()
{
register_plugin("TravTrie Test","1.0","Hawk552")
new TravTrie:CurTrie = TravTrieCreate(),Temp,Results[4]
server_print("TravTrie: %d",CurTrie)
TravTrieSetCellEx(CurTrie,0,99)
Results[0] = TravTrieGetCellEx(CurTrie,0,Temp)
TravTrieSetCellEx(CurTrie,1,3)
TravTrieSetStringEx(CurTrie,2,"ham")
new Cell,String[33],Non
Results[1] = TravTrieGetCellEx(CurTrie,1,Cell)
Results[2] = TravTrieGetStringEx(CurTrie,2,String,32)
Results[3] = TravTrieGetCellEx(CurTrie,31,Non)
server_print("Cell: %d / Temp: %d / String: %s / Non: %d / Results: %d %d %d %d",Cell,Temp,String,Non,Results[0],Results[1],Results[2],Results[3])
new travTrieIter:Iter = GetTravTrieIterator(CurTrie),Value
while(MoreTravTrie(Iter))
{
ReadTravTrieCell(Iter,Value)
server_print("Value: %d",Value)
}
DestroyTravTrieIterator(Iter)
TravTrieNth(CurTrie,1,String,32)
TravTrieGetCell(CurTrie,String,Cell)
server_print("Nth: %d",Cell)
}