AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   precached model replacing (https://forums.alliedmods.net/showthread.php?t=197155)

Bos93 09-29-2012 14:16

precached model replacing
 
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

ANTICHRISTUS 09-29-2012 16:01

Re: precached model replacing
 
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.

ConnorMcLeod 09-29-2012 18:28

Re: precached model replacing
 
Use content replacer plugin.

Bos93 09-29-2012 19:37

Re: precached model replacing
 
This module is not loaded.What function should be hook?

claudiuhks 09-30-2012 02:44

Re: precached model replacing
 
Do you mean PrecacheModel( char * ) MetaMod forward?

Bos93 09-30-2012 03:44

Re: precached model replacing
 
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

ConnorMcLeod 09-30-2012 04:33

Re: precached model replacing
 
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.


All times are GMT -4. The time now is 08:14.

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