new g_iOneModelID;
new g_iTwoModelID;
new g_iThreeModelID;
new g_iFourModelID;
new g_iFiveModelID;
new g_iSixModelID;
new g_iOneNickModelID;
public __fatal_ham_error(Ham:id, HamError:err, reason[])
{
new func = get_func_id("HamFilter", -1);
new bool:fail = 1;
new var1;
if (func != -1 && callfunc_begin_i(func, -1) == 1)
{
callfunc_push_int(id);
callfunc_push_int(err);
callfunc_push_str(reason, "HamFilter");
if (callfunc_end() == 1)
{
fail = false;
}
}
if (fail)
{
set_fail_state(reason);
}
return 0;
}
public plugin_init()
{
RegisterHam("HamFilter", "player", "Spawn_Post", 1);
return 0;
}
public plugin_precache()
{
static iOneModelWay[128];
formatex(iOneModelWay, 127, "models/player/%s/%s.mdl", "zw_priv_01", "zw_priv_01");
g_iOneModelID = engfunc("HamFilter", iOneModelWay);
static iTwoModelWay[128];
formatex(iTwoModelWay, 127, "models/player/%s/%s.mdl", "zw_priv_01", "zw_priv_01");
g_iTwoModelID = engfunc("HamFilter", iTwoModelWay);
static iThreeModelWay[128];
formatex(iThreeModelWay, 127, "models/player/%s/%s.mdl", "zw_priv_01", "zw_priv_01");
g_iThreeModelID = engfunc("HamFilter", iThreeModelWay);
static iFourModelWay[128];
formatex(iFourModelWay, 127, "models/player/%s/%s.mdl", "zw_priv_01", "zw_priv_01");
g_iFourModelID = engfunc("HamFilter", iFourModelWay);
static iFiveModelWay[128];
formatex(iFiveModelWay, 127, "models/player/%s/%s.mdl", "zw_priv_01", "zw_priv_01");
g_iFiveModelID = engfunc("HamFilter", iFiveModelWay);
static iSixModelWay[128];
formatex(iSixModelWay, 127, "models/player/%s/%s.mdl", "zw_priv_01", "zw_priv_01");
g_iSixModelID = engfunc("HamFilter", iSixModelWay);
static iOneNickModelWay[128];
formatex(iOneNickModelWay, 127, "models/player/%s/%s.mdl", "zw_nick1", "zw_nick1");
g_iOneNickModelID = engfunc("HamFilter", iOneNickModelWay);
return 0;
}
public Spawn_Post(iPlayer)
{
new var1;
if (!is_user_connected(iPlayer) || zp_get_user_zombie(iPlayer))
{
return 0;
}
new iName[32];
get_user_name(iPlayer, iName, 31);
if (get_user_flags(iPlayer, "HamFilter") & 16777216)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iOneModelID);
set_pev(iPlayer, 72, 0);
set_pdata_int(iPlayer, 491, g_iOneModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 524288)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iTwoModelID);
set_pev(iPlayer, 72, 1);
set_pdata_int(iPlayer, 491, g_iTwoModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 131072)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iThreeModelID);
set_pev(iPlayer, 72, 2);
set_pdata_int(iPlayer, 491, g_iThreeModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 32768)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iFourModelID);
set_pev(iPlayer, 72, 3);
set_pdata_int(iPlayer, 491, g_iFourModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 8192)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iFiveModelID);
set_pev(iPlayer, 72, 4);
set_pdata_int(iPlayer, 491, g_iFiveModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 2)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iSixModelID);
set_pev(iPlayer, 72, 5);
set_pdata_int(iPlayer, 491, g_iSixModelID, 5);
}
if (equal(iName, "MadMax", "HamFilter"))
{
zp_override_user_model(iPlayer, "zw_nick1", g_iOneNickModelID);
set_pdata_int(iPlayer, 491, g_iOneNickModelID, 5);
}
return 0;
}
public zp_user_humanized_post(iPlayer, iSurvivor)
{
if (iSurvivor)
{
return 0;
}
new iName[32];
get_user_name(iPlayer, iName, 31);
if (get_user_flags(iPlayer, "HamFilter") & 16777216)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iOneModelID);
set_pev(iPlayer, 72, 0);
set_pdata_int(iPlayer, 491, g_iOneModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 524288)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iTwoModelID);
set_pev(iPlayer, 72, 1);
set_pdata_int(iPlayer, 491, g_iTwoModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 131072)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iThreeModelID);
set_pev(iPlayer, 72, 2);
set_pdata_int(iPlayer, 491, g_iThreeModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 32768)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iFourModelID);
set_pev(iPlayer, 72, 3);
set_pdata_int(iPlayer, 491, g_iFourModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 8192)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iFiveModelID);
set_pev(iPlayer, 72, 4);
set_pdata_int(iPlayer, 491, g_iFiveModelID, 5);
}
if (get_user_flags(iPlayer, "HamFilter") & 2)
{
zp_override_user_model(iPlayer, "zw_priv_01", g_iSixModelID);
set_pev(iPlayer, 72, 5);
set_pdata_int(iPlayer, 491, g_iSixModelID, 5);
}
if (equal(iName, "MadMax", "HamFilter"))
{
zp_override_user_model(iPlayer, "zw_nick1", g_iOneNickModelID);
set_pdata_int(iPlayer, 491, g_iOneNickModelID, 5);
}
return 0;
}