how to precache models using cvar ? i have a config file myconfig.cfg and exec it to server in this file some cvars and model cvar but plugin doesn't work
myconfig.cfg
cvar_mymodel = "someModel"
amxx sample:
PHP Code:
public plugin_init()
{
mymodel = register_cvar("cvar_mymodel", "someModel")
}
public plugin_cfg()
{
static cfgdir[32]
get_configsdir(cfgdir, charsmax(cfgdir))
server_cmd("exec %s/myconfig.cfg", cfgdir)
}
public plugin_precache()
{
static modelname[128]
new MODEL[20]
get_pcvar_string(mymodel, MODEL, charsmax( MODEL ));
formatex(modelname, 127, "models/player/%s/%s.mdl", MODEL, MODEL)
engfunc(EngFunc_PrecacheModel, modelname)
}
this is true ?