Ironic how silencer has "Fakemeta GOOD, Engine BAD" in his sig yet gave you a script with engine in it. tsk tsk tsk. Practice what you preach I say.
Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
new VERSION[]="1.0"
public plugin_precache()
{
precache_model("models/skins/auto/v_auto.mdl")
precache_model("models/models/skins/auto/p_auto.mdl")
precache_model("tmodelhere")//place ur t custom model here
precache_model("ctmodelhere")//ditto
}
public plugin_init()
{
register_plugin("WW2",VERSION,"Enblad")
register_event("ResetHUD","changePlayer","be")
register_event("CurWeapon","weaponChange","be","1=1")
}
public weaponChange(id)//this function is called when a player changes their weapon
{
new wpnid = read_data(2)//find what is the players current weapon
if(wpnid == CSW_XM1014)// make sure the current weapon is the shotgun
{
//change models using FAKEMETA
set_pev(id, pev_viewmodel2, "models/skins/auto/v_auto.mdl")
set_pev(id, pev_weaponmodel2, "models/skins/auto/p_auto.mdl")
}
return PLUGIN_CONTINUE
}
public changePlayer(id)//this function is called on every reset hud.
{
new CsTeams:iTeam = cs_get_user_team(id)// get the team of the player to change their model by team
switch(iTeam)
{
case CS_TEAM_T://player is on terrorist team
{
cs_set_user_model(id, "tmodelhere")//terrorist custom model
}
case CS_TEAM_CT://player is on ct team
{
if(!cs_get_user_vip(id))//make sure player is not vip should the map be a vip map
{
cs_set_user_model(id, "ctmodelhere")//ct custom model
}
}
}
return PLUGIN_CONTINUE
}