A trie is for storing key/value pairs. If you're just storing values (in this case, strings), you may want to use an adt_array along with
FindStringInArray.
Specifically, the logic for using an adt_array would look like this:
PHP Code:
#include <adt_array>
new Handle:g_hDenyArray = INVALID_HANDLE;
public OnPluginStart()
{
new stringSize = ByteCountToCells(30);
g_hDenyArray = CreateArray(stringSize);
}
public OnMapStart()
{
ClearArray(g_hDenyArray);
}
public OnClientPostAdminCheck(client)
{
new String:steamid[30];
GetClientAuthString(client, steamid, sizeof(steamid));
if (FindStringInArray(g_hDenyArray, steamid) != -1)
{
//ACTION
}
}
public OnClientDisconnect(client)
{
new String:steamid[30];
GetClientAuthString(client, steamid, sizeof(steamid));
new position = FindStringInArray(g_hDenyArray, steamid);
if (position == -1)
{
PushArrayString(g_hDenyArray, steamid);
}
}
Side note: I also adjusted it to clear the array every map change instead of repeatedly creating it.
__________________