| leonardo121 |
07-24-2017 15:16 |
precaching model!(not precaching!)
Hello everyone!
i have this plugin, made by exolent , (thanks)
The problem is the plugin is not precaching the model,
On the server it shows that everything is okay, but no downloading and not seting the new model!!
PHP Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich>
new gWeaponModels[CSW_P90 + 1][64];
public plugin_precache() { new configFile[64]; get_configsdir(configFile, charsmax(configFile)); add(configFile, charsmax(configFile), "/weapon_models.ini"); new f = fopen(configFile, "rt"); if(f) { new data[128], line, className[32], model[64], weaponId; while(!feof(f)) { fgets(f, data, charsmax(data)); trim(data); line++; if(!data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/') { continue; } parse(data, className, charsmax(className), model, charsmax(model)); if((weaponId = get_weaponid(className))) { if(file_exists(model)) { precache_model(model); RegisterHam(Ham_Item_Deploy, className, "FwdItemDeployPost", 1); copy(gWeaponModels[weaponId], charsmax(gWeaponModels[]), model);
server_cmd("echo Model file ^"%s^" found from config file on line %d", model, line); } else { server_cmd("echo Model file ^"%s^" not found from config file on line %d", model, line); } } else { server_cmd("echo Invalid weapon class ^"%s^" from config file on line %d", className, line); } } fclose(f); } }
public plugin_init() { register_plugin("Weapon Models", "0.0.1", "Exolent"); }
public FwdItemDeployPost(entity) { const m_pPlayer = 41; const m_iId = 43; new id = get_pdata_cbase(entity, m_pPlayer, 4); if(is_user_alive(id)) { new weaponId = get_pdata_int(entity, m_iId, 4); if(0 < weaponId <= CSW_P90 && gWeaponModels[weaponId][0]) { set_pev(id, pev_weaponmodel2, gWeaponModels[weaponId]); } } }
|