Nice rip off.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <gunxpmod>
//#include <hamsandwich>
#include <fakemeta>
#include <zombieplague>
new bool:HasPred[33];
new const PLAYER_MODELS[][]=
{
"Pred" // preds model
};
public plugin_init()
{
register_plugin("Predator Model","1.0","xbatista")
register_gxm_item("Predator", "Gives you Predator model", 400)
//RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn", 1)
}
public plugin_precache()
{
new modelpath_human[100]
for(new i = 0; i < sizeof PLAYER_MODELS; i++)
{
formatex(modelpath_human, sizeof modelpath_human - 1, "models/player/%s/%s.mdl", PLAYER_MODELS[i], PLAYER_MODELS[i])
if( !file_exists( modelpath_human ) )
{
return 0;
}
engfunc(EngFunc_PrecacheModel, modelpath_human);
formatex(modelpath_human, sizeof modelpath_human - 1, "models/player/%s/%sT.mdl", PLAYER_MODELS[i], PLAYER_MODELS[i])
if ( file_exists( modelpath_human ) )
{
engfunc(EngFunc_PrecacheModel, modelpath_human);
return 1;
}
}
return 1;
}
public gxm_item_enabled(id)
{
HasPred[id] = true;
if ( is_user_alive(id) && !zp_get_user_zombie(id) )
{
cs_set_user_model(id, PLAYER_MODELS[0]);
}
}
public client_connect(id)
{
HasPred[id] = false;
}
public zp_user_humanized_pre(id, survivor)
{
if ( !is_user_alive(id) || !HasPred[id] )
return;
cs_set_user_model(id, PLAYER_MODELS[0]);
}
/*public fwd_PlayerSpawn(id)
{
if ( !is_user_alive(id) || !HasPred[id] || zp_get_user_zombie(id) )
return;
set_task( 5.0, "TaskedModel", id)
}
public TaskedModel(id)
{
if ( !is_user_alive(id) || !HasPred[id] || zp_get_user_zombie(id) )
return;
cs_set_user_model(id, PLAYER_MODELS[0]);
}*/
https://forums.alliedmods.net/showthread.php?t=115697