Okay i will tell you what i just did:
Code:
#include <amxmodx>
#include <engine> // this plugin requires Engine
public plugin_init()
{
register_plugin("oh hello" , "1.0" , "v3x");
register_event("CurWeapon" , "set_models" , "be" , "1=1"); // if we don't check for the isActive parameter then the skins will act up and change unexpectedly on you (if 0)
}
public plugin_precache()
{
precache_model("models/v_glock18.mdl"); // the view model
precache_model("models/p_glock18.mdl"); // the player (view) model
}
public set_models(id)
{
if(!is_user_alive(id)) // if the player is dead for some reason, prevent the rest of the function from being executed
{
return PLUGIN_HANDLED;
}
new clip, ammo, weapid = get_user_weapon(id, clip, ammo);
switch(weapid)
{
case CSW_DEAGLE: // check if it's the weapon ID we want (see below for weapon constants)
{
entity_set_string(id , EV_SZ_viewmodel , "models/v_glcok18.mdl"); // set the view model
entity_set_string(id , EV_SZ_weaponmodel , "models/p_glcok18.mdl"); // set the player (view) model
}
}
return PLUGIN_CONTINUE;
}
1) I took the files i dled and i put my p_glock18, v_glock18, and w_glock18 in the Models folder.
2) I took the plugin and placed it in my plugins folder
3) i edited the plugins.ini