Raised This Month: $7 Target: $400
 1% 

[INC] DTC - DownloadTableConfig


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-02-2015 , 14:08   [INC] DTC - DownloadTableConfig
Reply With Quote #1

Ciao guys,

I made this include for my plugins and now I decided to make it public for you all.

With DTC you can easily create download config and give some files prefixes, which highlight that file on config loading (and also can contain some arguments set by server master).
You no more need to create bunch of convars or KeyValue config for settings of your files (like scale of the texture, team for the texture etc.).

More info and downloads in GitHub repository and if you find any bugs, let me know please.

Config example:
PHP Code:
// comment line
# comment line
comment line

[GamePrepare 3]     sound/timeleft/en/unreal/3sec.mp3
[GamePrepare 2]     sound/timeleft/en/unreal/2sec.mp3
[GamePrepare 1]     sound/timeleft/en/unreal/1sec.mp3

[GameEnd RedTeam]   sound/sm_hosties/noscopestart1.mp3
[GameEnd BlueTeam]  sound/sm_hosties/noscopestart1.mp3

[PlayerSkin Redmodels/player/prisoner/prisoner_red_fix.mdl
    models
/player/prisoner/prisoner_red_fix.dx90.vtx
    models
/player/prisoner/prisoner_red_fix.phy
    models
/player/prisoner/prisoner_red_fix.vvd

[PlayerSkin Bluemodels/player/prisoner/prisoner_blue_fix.mdl
    models
/player/prisoner/prisoner_blue_fix.dx90.vtx
    models
/player/prisoner/prisoner_blue_fix.phy
    models
/player/prisoner/prisoner_blue_fix.vvd

[Mark Red 12.0 0.125materials/decals/custom/redstar.vmt
    materials
/decals/custom/redstar.vtf

[Mark Blue 12.0 0.125materials/decals/custom/bluestar.vmt
    materials
/decals/custom/bluestar.vtf 
How to use:
  1. Include DTC
    PHP Code:
    #include <dtc> 
  2. Create config (optional)
    PHP Code:
    public OnPluginStart()
    {
        
    DTC_CreateConfig(ConfigPathOnCreateConfig);
    }

    public 
    OnCreateConfig(String:sConfigPath[], Handle:hConfigFile)
    {
        
    WriteFileLine(hConfigFile"// [Mark <team> <scale> <offset>]");
        
    WriteFileLine(hConfigFile"");
        
    WriteFileLine(hConfigFile"[Mark Red 0.125 12.0] materials/sprites/laserbeam.vmt");

  3. Load config
    PHP Code:
    public OnPluginStart()
    {
        
    DTC_LoadConfig(ConfigPathOnFile);
    }

    public 
    OnFile(String:sFile[], String:sPrefixName[DTC_MAX_NAME_LEN], Handle:hArgs)
    {
        
    // Catch file with prefix "Mark"
        
    if (StrEqual(sPrefixName"Mark")) {

                new 
    String:sHelper[64];
                
    DTC_GetArg(hArgs1sHelpersizeof(sHelper), "ERROR");

                
    LogMessage("File = '%s'"sFile);
                
    LogMessage("Arg1 = '%s'"sHelper);
                
    LogMessage("Arg2 = '%.3f'"DTC_GetArgFloat(hArgs20.0));
                
    LogMessage("Arg3 = '%.3f'"DTC_GetArgFloat(hArgs3, -1.0));
        }


Last edited by KissLick; 04-04-2015 at 15:42.
KissLick is offline
lowie
Member
Join Date: May 2014
Old 05-01-2015 , 05:34   Re: [INC] DTC - DownloadTableConfig
Reply With Quote #2

works well, I used this.
lowie is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 05-02-2015 , 17:01   Re: [INC] DTC - DownloadTableConfig
Reply With Quote #3

Thx, any suggestions appreciated.
KissLick is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:41.


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