Veteran Member
Join Date: Jul 2008
Location: Romania
|
03-20-2017
, 12:41
precaching textures not working
|
#1
|
Hi Allied Modders users, i have a question about precaching textures, bouth of codes works on a CS:S server, still not sure about second but first works just fine, on Source Mod 1.7.3 but on SM 1.8.0 none of them works why ?
PHP Code:
public PrecacheSkyBoxTexture ( )
{
/****************************************************************************************************************/
decl String:newskybox [ 32 ];
GetConVarString ( cvarSkybox, newskybox, sizeof ( newskybox ) );
decl String:skyname_download1 [ 128 ];
Format ( skyname_download1, sizeof ( skyname_download1 ), "materials/skybox/%sup.vtf", newskybox );
AddFileToDownloadsTable ( skyname_download1 );
decl String:skyname_dld20 [ 128 ];
Format ( skyname_dld20, sizeof ( skyname_dld20 ), "materials/skybox/%sdn.vtf", newskybox );
AddFileToDownloadsTable ( skyname_dld20 );
decl String:skyname_dld21 [ 128 ];
Format ( skyname_dld21, sizeof ( skyname_dld21 ), "materials/skybox/%sft.vtf", newskybox );
AddFileToDownloadsTable ( skyname_dld21 );
decl String:skyname_dld22 [ 128 ];
Format ( skyname_dld22, sizeof ( skyname_dld22 ), "materials/skybox/%slf.vtf", newskybox );
AddFileToDownloadsTable ( skyname_dld22 );
decl String:skyname_dld23 [ 128 ];
Format ( skyname_dld23, sizeof ( skyname_dld23 ), "materials/skybox/%srt.vtf", newskybox );
AddFileToDownloadsTable ( skyname_dld23 );
decl String:skyname_dld24 [ 128 ];
Format ( skyname_dld24, sizeof ( skyname_dld24 ), "materials/skybox/%sbk.vtf", newskybox );
AddFileToDownloadsTable ( skyname_dld24 );
/******************************End of VTF Texture*****************************************************************/
decl String:skyname_download3 [ 128 ];
Format ( skyname_download3, sizeof ( skyname_download3 ), "materials/skybox/%sup.vmt", newskybox );
AddFileToDownloadsTable ( skyname_download3 );
decl String:skyname_dld30 [ 128 ];
Format ( skyname_dld30, sizeof ( skyname_dld30 ), "materials/skybox/%sdn.vmt", newskybox );
AddFileToDownloadsTable ( skyname_dld30 );
decl String:skyname_dld31 [ 128 ];
Format ( skyname_dld31, sizeof ( skyname_dld31 ), "materials/skybox/%sft.vmt", newskybox );
AddFileToDownloadsTable ( skyname_dld31 );
decl String:skyname_dld32 [ 128 ];
Format ( skyname_dld32, sizeof ( skyname_dld32 ), "materials/skybox/%slf.vmt", newskybox );
AddFileToDownloadsTable ( skyname_dld32 );
decl String:skyname_dld33 [ 128 ];
Format ( skyname_dld33, sizeof ( skyname_dld33 ), "materials/skybox/%srt.vmt", newskybox );
AddFileToDownloadsTable ( skyname_dld33 );
decl String:skyname_dld34 [ 128 ];
Format ( skyname_dld34, sizeof ( skyname_dld34 ), "materials/skybox/%sbk.vmt", newskybox );
AddFileToDownloadsTable ( skyname_dld34 );
/****************************End of VMT Textures******************************************************************/
}
and second , not sure if it is working at all
PHP Code:
void PrecacheSkyBoxTexture ( )
{
static char suffix [ ] [ ] =
{
"bk",
"Bk",
"dn",
"Dn",
"ft",
"Ft",
"lf",
"Lf",
"rt",
"Rt",
"up",
"Up",
};
decl String:newskybox [ 32 ];
GetConVarString ( cvarSkybox, newskybox, sizeof ( newskybox ) );
char buffer[ 64];
for ( int i = 0; i < sizeof ( suffix ); i++ )
{
FormatEx ( buffer, sizeof ( buffer ), "materials/skybox/%s%s.vtf", newskybox, suffix [ i ] );
if ( FileExists ( buffer, false ) )
AddFileToDownloadsTable ( buffer );
FormatEx ( buffer, sizeof ( buffer ), "materials/skybox/%s%s.vmt", newskybox, suffix [ i ] );
if ( FileExists ( buffer, false ) )
AddFileToDownloadsTable ( buffer );
}
}
Any help ?
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
Last edited by CryWolf; 03-20-2017 at 13:39.
Reason: solved, it was from my client.
|
|