Raised This Month: $ Target: $400
 0% 

precached model replacing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-29-2012 , 14:16   precached model replacing
Reply With Quote #1

how to replace properly precached resource (model/sound/sprite) to another one ?

I need replace models, not block, because blocking throws an error, that model hasnt been precached

Example:

v_ak47.mdl
p_ak47.mdl
w_ak47.mdl
v_m4a1.mdl
p_m4a1.mdl
w_m4a1.mdl

-->

null.mdl

-5 models unprecache
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 09-29-2012 , 16:01   Re: precached model replacing
Reply With Quote #2

I don't understand your request, so my answer may be off-topic:
  • you can use the weapon model replacement as plugin.
  • and search the word null in my posts to find that model.
btw. wrong sub-forum.
__________________
ANTICHRISTUS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-29-2012 , 18:28   Re: precached model replacing
Reply With Quote #3

Use content replacer plugin.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-29-2012 , 19:37   Re: precached model replacing
Reply With Quote #4

This module is not loaded.What function should be hook?
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 09-30-2012 , 02:44   Re: precached model replacing
Reply With Quote #5

Do you mean PrecacheModel( char * ) MetaMod forward?
__________________

Last edited by claudiuhks; 09-30-2012 at 02:45.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-30-2012 , 03:44   Re: precached model replacing
Reply With Quote #6

PrecacheModel( char * ) == FM_PrecacheModel

PHP Code:
public plugin_precache()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_forward(FM_PrecacheModel"fm_Precache");
}

public 
fm_Precache(model[])
{
    if(
equal(models/v_ak47.mdlmodel))
    {
        
forward_return(FMV_CELLengfunc(EngFunc_PrecacheModel"models/null.mdl"));
            
        return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_HANDLED;

model not precached
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-30-2012 , 04:33   Re: precached model replacing
Reply With Quote #7

Moving this thread to scripting/help forum.

You can't just replace the precache, you also have to replace w_ models in SetModel fonction and p_ and v_ model in Deploy function.
See this snippet : http://forums.alliedmods.net/showpos...8&postcount=61

So even if you think there won't ever be any ak47 created on your server, it's better to make sure that eventuality is covered by your plugin.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 08:14.


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