AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   reeplace engfunc for temp entity (https://forums.alliedmods.net/showthread.php?t=340508)

Dirty Harry 11-22-2022 16:06

reeplace engfunc for temp entity
 
Hello, I wanted to know another way to add the sprite to a temp entity, at least I know currently 2, I want to use the 2nd option, but, if I have 2 plugins, and I use the same sprite, I would have to precache the same sprite twice , and I don't want to use engfunc, what other option do I have?

PHP Code:

        message_begin(0SVC_TEMPENTITY);
        
write_byte(TE_SPRITE);
        
write_coord_f(Origin[0]);
        
write_coord_f(Origin[1]);
        
write_coord_f(Origin[2]);
        
write_shortengfuncEngFunc_ModelIndexSPR ) );
        
write_byte(Scale);
        
write_byte(Brillo);
        
message_end(); 

PHP Code:

new SPRITE
SPRITE 
precache_model"sprites/black.spr" );

        
message_begin(0SVC_TEMPENTITY);
        
write_byte(TE_SPRITE);
        
write_coord_f(Origin[0]);
        
write_coord_f(Origin[1]);
        
write_coord_f(Origin[2]);
        
write_short(SPRITE);
        
write_byte(Scale);
        
write_byte(Brillo);
        
message_end(); 


fysiks 11-25-2022 22:41

Re: reeplace engfunc for temp entity
 
The precaching functionality only precaches each file once regardless of how many plugins require it. See this thread for this same question with the answer.


All times are GMT -4. The time now is 15:37.

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