This code should replace all T's model to test999 Player Model. But it does replace all CT player Models too.. why??
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define VERSION "0.0.1"
new Trie:g_tModels
public plugin_init()
{
register_plugin("KadiR Models", VERSION, "ConnorMcLeod")
register_forward(FM_SetClientKeyValue, "SetClientKeyValue")
g_tModels = TrieCreate()
TrieSetString(g_tModels, "terror", "test999")
TrieSetString(g_tModels, "leet", "test999")
TrieSetString(g_tModels, "guerilla", "test999")
TrieSetString(g_tModels, "arctic", "test999")
}
public plugin_end()
{
TrieDestroy(g_tModels)
}
public plugin_precache()
{
precache_model("models/player/test999/test999.mdl")
}
public SetClientKeyValue(id, szInfoBuffer[], szKey[], szValue[])
{
static const model[] = "model"
if( equal(szKey, model) )
{
static szModel[12]
TrieGetString(g_tModels, szValue, szModel, charsmax(szModel));
set_user_info(id, model, szModel)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}