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_newdeag.mdl"); // the view model
precache_model("models/p_newdeag.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 weapid = read_data(2); // get the weapon ID
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_newdeag.mdl"); // set the view model
entity_set_string(id , EV_SZ_weaponmodel , "models/p_newdeag.mdl"); // set the player (view) model
}
}
return PLUGIN_CONTINUE;
}
Thats what i have
heres what i did:
1) Make that plugin an SMA
2) Compile it with AMXX Compiler
3) Got my Model for the deagle and replaced it with the old one
4) Put my plugin in my plugins folder
5) Added it to plugins.ini
6) Restarted my server
7) Tried to use it but it didn't work....
What am I doing wrong?
[/code]