AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what is diffrent between this PRECACHE (https://forums.alliedmods.net/showthread.php?t=314964)

SHIELD755 03-15-2019 08:43

what is diffrent between this PRECACHE
 
i have seen this code of PRECACHE in two plugin for precaching SPRITE and i am little bit confuse between them so can anybody give some details of it and suggest me that which is CODE is best for use :)


1st

PHP Code:

precache_generic"sprites/blood.spr" 

2nd

PHP Code:

precache_model("sprites/blood.spr"


iNvectus 03-15-2019 09:20

Re: what is diffrent between this PRECACHE
 
Precache generic is used to precache generic file types. Example: with precache_generic you can do:

PHP Code:

precache_generic("de_torn.wad"

What you cannot do with precache_generic? You can't precache a sound file correctly, instead use precache_sound.


On the other hand,
precache_model is used to pre-load a model that is going to be used. It is often used for sprites as well. As it comes to sprites, it makes no difference. Sometimes you might encounter errors, sometimes you may not. I suggest you using it as an alternative to precache_model, if it's sprite-specific.

SHIELD755 03-15-2019 09:23

Re: what is diffrent between this PRECACHE
 
Quote:

Originally Posted by invectus (Post 2643419)
precache generic is used to precache generic file types. Example: With precache_generic you can do:

PHP Code:

precache_generic("de_torn.wad"

what you cannot do with precache_generic? You can't precache a sound file correctly, instead use precache_sound.


On the other hand,
precache_model is used to pre-load a model that is going to be used. It is often used for sprites as well. As it comes to sprites, it makes no difference. Sometimes you might encounter errors, sometimes you may not. I suggest you using it as an alternative to precache_model, if it's sprite-specific.


thanks for quick reply !!! :)

CrazY. 03-15-2019 09:32

Re: what is diffrent between this PRECACHE
 
precache_generic, to precache any other sound than .wav, wad files, txt files, weapon hud sprites (e.g. sprites/640hud15.spr), etc.

precache_model, to precache models and the sprites that will be used with temporary entities or set as an entity's model.

SHIELD755 03-15-2019 09:36

Re: what is diffrent between this PRECACHE
 
Quote:

Originally Posted by CrazY. (Post 2643422)
precache_generic, to precache any other sound than .wav, wad files, txt files, weapon hud sprites (e.g. sprites/640hud15.spr), etc.

precache_model, to precache models and the sprites that will be used with temporary entities or set as an entity's model.

Oh yes i take the 2nd code from m32 launcher :) which is temporary entity

THANKS :) !!


All times are GMT -4. The time now is 20:38.

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