Hi there, helping the noobs people! I really want to ask you, where am I wrong in this code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <fakemeta>
// Define the Plugin Version
new const VERSION[] = { "1.0" };
#define vip ADMIN_LEVEL_G
public plugin_init()
{
register_plugin("AdminModels", VERSION, "Flicker");
RegisterHam(Ham_Spawn,"player","FnHamSpawn",1);
}
public plugin_precache()
{
precache_model("models/player/AdminT/AdminT.mdl");
precache_model("models/player/AdminCT/AdminCT.mdl");
precache_model("models/noj12.mdl")
}
public FnHamSpawn(id)
{
if(is_user_alive(id))
{
if(get_user_flags(id) & vip)
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
cs_set_user_model(id,"AdminCT");
}
else
{
cs_set_user_model(id,"AdminT");
}
}
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/noj12.mdl");
}
}
}
The purpose is a special model for the admin player (that's working) and a knife model for everyone in the server. And here comes the problem: when i connect to the server and start playing, I'm shooting with my knife

Maybe the check for the weapon is worng, or I don't know, but the weapon in my hands is the glock18, but the model is the knife. Idk, if you help me, it will be great!!! Thanks a lot!