Everyone knows that if the models weren't in the right place to start with then CS would have crashed due to the inability to precache "non existing" models. I've made sure that all neccessary modules are there and I've even tried forcing them to be enabled in modules.ini after failed attempts and runing the plugin with the default file. No cigar.
This is a plugin that changes my deagle model:
Code:
#include <amxmodx>
#include <engine>
#include <amxmisc>
public plugin_init()
{
// Plugin Info
register_plugin("Deagle Model Change","1.0","Dontask-jello")
register_event("CurWeapon", "weaponChange", "be", "1=1")
register_cvar("sv_gold_deagle", "1")
return PLUGIN_CONTINUE
}
public plugin_precache()
{
precache_model("models/v_goldcchs_deagle.mdl")
precache_model("models/p_goldcchs_deagle.mdl")
return PLUGIN_CONTINUE
}
public weaponChange(id)
if (get_cvar_num("sv_gold_deagle"))
{
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid == CSW_DEAGLE) {
entity_set_string(id, EV_SZ_viewmodel, "models/v_goldcchs_deagle.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "models/p_goldcchs_deagle.mdl")
}
}
Now this plugin works. The silver weapons plugin doesn't. The code is 90% identical, the only difference being that the silver weapons plugin declares (id,clip,ammo) individually every time it checks to see what you weapon you have as opposed to this declaring it once as a variable. yes, I have tried changing the code in the silver plugin and it compiled fine but didn't solve a thing.
__________________