PDA

View Full Version : [Plugin] Custom Sky [CS:S | CS:GO| ZP:S]



~TraNda~
26-10-2015, 06:22 PM
Descriere: Acest plugin va va schimba cerul in Counter-Strike: Source, Zombie Panic: Source, Counter-Strike: Global Offensive cu unul mentionat de dv's sau unul custom are urmatoarele functii active

Plugin: Custom Sky
Versiune: 1.3
Autor: CryWolf
Download: Va las .sma . Il compilati si voi :)

/*

-------------------------------------------------------------
Cusom SKY Changer
v1.3 by CryWolf
<b>You have to register to ba able to see this link</b>*********.com

- Provides realtime sky change features
- Auto precache the needed sky texture
- Simple code
- Extra config features

-------------------------------------------------------------
*/


#include < sourcemod >
#include < sdktools >

#pragma semicolon 1


// Plugin Information
#define PLUGIN_VERSION "1.3"
#define INDEX 0

// pCvarS:
new Handle:cvarEnabled;
new Handle:cvarSkybox;


public Plugin:myinfo =
{
name = "Sky Changer",
author = "CryWolf",
description = "Provides Sky changer feature",
version = PLUGIN_VERSION,
url = "<b>You have to register to ba able to see this link</b>*********.com"
};

public OnPluginStart ( )
{
cvarEnabled = CreateConVar ( "sm_custom_sky", "1.0", "Skybox plugin on / off", FCVAR_PLUGIN, true, 0.0, true, 1.0 );
cvarSkybox = CreateConVar ( "sm_skybox_name", "blood1_", "Skybox texture name", FCVAR_PLUGIN );

// Load configuration file
AutoExecConfig ( true, "skychanger" );

}

public OnMapStart ( )
{
if ( GetConVarBool ( cvarEnabled ) ) {
PrecacheSkyBoxTexture ( );
ChangeSkyboxTexture ( );
}
}

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****************************************** ************************/
}

public ChangeSkyboxTexture ( )
{
if ( GetConVarBool ( cvarEnabled ) )
{
decl String:newskybox [ 32 ];
GetConVarString ( cvarSkybox, newskybox, sizeof ( newskybox ) );

// If there is a convar set, change the skybox to it
if ( strcmp ( newskybox, "", false ) !=0 )
{
// PrintToServer ( "[CSC] Changing the Skybox to %s", newskybox );
DispatchKeyValue ( INDEX, "skyname", newskybox );
}
}
}

Instalare:
1.Fisierul plugin.sp il puneti in addons/sourcemod/scripting.
2.Fisierul plugin.smxi il puneti inaddons/sourcemod/plugins .

Cvar-uri:
sm_custom_sky 1.0 / 0.0 : Plugin Activ / Plugin inactiv
sm_skybox_name blood1_ : Numele texturii din matersials/skybox [fara extensii .VMT , .VTF]

Video:

<b>You have to register to ba able to see this link</b>