Raised This Month: $ Target: $400
 0% 

Precaching models


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mettyou
Junior Member
Join Date: Apr 2008
Old 06-03-2010 , 06:05   Precaching models
Reply With Quote #1

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(cfgdircharsmax(cfgdir))
    
server_cmd("exec %s/myconfig.cfg"cfgdir)
}


public 
plugin_precache()
{
    static 
modelname[128]
    new 
MODEL[20]
    
get_pcvar_string(mymodelMODELcharsmaxMODEL ));
    
    
formatex(modelname127"models/player/%s/%s.mdl"MODELMODEL)
    
engfunc(EngFunc_PrecacheModelmodelname)

this is true ?
mettyou is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode