Raised This Month: $32 Target: $400
 8% 

[CSGO] AlfaLoader - Config Executor


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ShutUP99
Junior Member
Join Date: Jan 2018
Location: Portuguese
Plugin ID:
6212
Plugin Version:
1.0
Plugin Category:
Server Management
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Well, today i will realease a CSGO plugin to load configs that are in the folder configs/configexecutor.cfg or in configexecutor/configs.cfg!
    Old 07-31-2018 , 18:02   [CSGO] AlfaLoader - Config Executor
    Reply With Quote #1

    Description:
    Well, today i will realease a CSGO plugin to load configs that are in the folder configs/configexecutor.cfg or in configexecutor/configs.cfg!

    Plugin Info:
    The plugin have 2 languages:

    -> English
    -> Portuguese

    Plugin Sourcecodes:

    English Version Code:
    PHP Code:
    /*************************************************************************
    *                                                                        *
    *                      AlfaLoader - Config Executor                      * 
    *                            Author: ShutUP                              *
    *                             Version: 1.0                               *
    *                                                                        *
    **************************************************************************/

    #include <sourcemod>

    public Plugin myinfo 
    {
        
    name "[SM] AlfaLoader",
        
    author "ShutUP",
        
    description "Config Executer for CSGO Servers",
        
    version "1.0",
        
    url "https://alfahosting.gq/plugins/csgo/configexecuter"
    }

    public 
    OnPluginStart()
    {
        
    CreateConVar("sm_executorversion""1.0""Show the version of the plugin"FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
        
    RegAdminCmd("sm_executeconfigs_all"CmdReExecuteADMFLAG_GENERIC"Execute the config files insile the folder");
        
    PrintToServer("Plugin maked by ShutUP with love");
    }

    public 
    OnMapStart()
    {
        
    ExecuteAllConfigs();
    }

    stock bool ExecuteAllConfigs()
    {
        new 
    Float:time 0.0;
        new 
    Handle:file INVALID_HANDLE;    
        
    decl String:FileName[256], String:ConfigName[256];
        
    BuildPath(Path_SMFileNamesizeof(FileName), "configexecutor/config.cfg");    
        new 
    len;
        if(!
    FileExists(FileName))
        {
            
    LogError("Error loading the config files");
            return 
    false;
        }
        
    file OpenFile(FileName"r");
        if(
    file == INVALID_HANDLE)
        {
            
    LogError("Error loading the config files");
            return 
    false;
        }
        
        while(
    ReadFileLine(fileConfigNamesizeof(ConfigName)))
        {
            
    len strlen(ConfigName);
            if (
    ConfigName[len-1] == 'n')
            {
                
    ConfigName[--len] = '0';
            }
            if(
    StrEqual(ConfigName""))
            {
                continue;
            }
            
    time+=0.1;
            new 
    Handle:pack CreateDataPack();
            
    WritePackString(packConfigName);
            
    CreateTimer(timeExecuteConfigpackTIMER_FLAG_NO_MAPCHANGE);
            if(
    IsEndOfFile(file))
            {
                break;
            }
        }
        
    CloseHandle(file);
        return 
    true;
    }

    public 
    Action CmdReExecute(clientargs)
    {
        if(
    ExecuteAllConfigs())
        {
            
    PrintToChat(client"[AlfaLoader] All configs are been executed!");
        }
        else
        {
            
    PrintToChat(client"[AlfaLoader] An error ocurred while executing the files!");
        }
        return 
    Plugin_Handled;
    }

    public 
    Action ExecuteConfig(Handle timerHandle pack)
    {
        
    ResetPack(pack);
        
    decl String:config[256];
        
    ReadPackString(packconfigsizeof(config));
        
    ServerCommand("exec sourcemod/%s"config);

    Portuguese Version Code:
    PHP Code:
    /*************************************************************************
    *                                                                        *
    *                      AlfaLoader - Config Executor                      * 
    *                            Author: ShutUP                              *
    *                             Version: 1.0                               *
    *                                                                        *
    **************************************************************************/

    #include <sourcemod>

    public Plugin myinfo 
    {
        
    name "[SM] AlfaLoader",
        
    author "ShutUP",
        
    description "Executor de configurações para servidores de CS:GO",
        
    version "1.0",
        
    url "https://alfahosting.gq/plugins/csgo/configexecuter"
    }

    public 
    OnPluginStart()
    {
        
    CreateConVar("sm_executorversion""1.0""Mostra a versão do plugin"FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
        
    RegAdminCmd("sm_executeconfigs_all"CmdReExecuteADMFLAG_GENERIC"Executa as configs dentro da pasta");
        
    PrintToServer("Plugin feito por ShutUP com amor");
    }

    public 
    OnMapStart()
    {
        
    ExecutarTodasAsConfig();
    }

    stock bool ExecutarTodasAsConfig()
    {
        new 
    Float:time 0.0;
        new 
    Handle:file INVALID_HANDLE;    
        
    decl String:FileName[256], String:ConfigName[256];
        
    BuildPath(Path_SMFileNamesizeof(FileName), "configexecutor/config.cfg");    
        new 
    len;
        if(!
    FileExists(FileName))
        {
            
    LogError("Erro ao executar as configs");
            return 
    false;
        }
        
    file OpenFile(FileName"r");
        if(
    file == INVALID_HANDLE)
        {
            
    LogError("Erro ao executar as configs");
            return 
    false;
        }
        
        while(
    ReadFileLine(fileConfigNamesizeof(ConfigName)))
        {
            
    len strlen(ConfigName);
            if (
    ConfigName[len-1] == 'n')
            {
                
    ConfigName[--len] = '0';
            }
            if(
    StrEqual(ConfigName""))
            {
                continue;
            }
            
    time+=0.1;
            new 
    Handle:pack CreateDataPack();
            
    WritePackString(packConfigName);
            
    CreateTimer(timeExecuteConfigpackTIMER_FLAG_NO_MAPCHANGE);
            if(
    IsEndOfFile(file))
            {
                break;
            }
        }
        
    CloseHandle(file);
        return 
    true;
    }

    public 
    Action CmdReExecute(clientargs)
    {
        if(
    ExecutarTodasAsConfig())
        {
            
    PrintToChat(client"[AlfaLoader] Todos as configs foram executados!");
        }
        else
        {
            
    PrintToChat(client"[AlfaLoader] Um erro ocurreu ao executar todas as configs!");
        }
        return 
    Plugin_Handled;
    }

    public 
    Action ExecuteConfig(Handle timerHandle pack)
    {
        
    ResetPack(pack);
        
    decl String:config[256];
        
    ReadPackString(packconfigsizeof(config));
        
    ServerCommand("exec sourcemod/%s"config);


    The plugin come with a NoSpread config:
    PHP Code:
    // THIS CONFIG IS FOR CSGO NOSPREAD SERVER!
    sv_cheats 1
    weapon_accuracy_nospread 
    "1"
    weapon_debug_spread_gap "1"
    weapon_recoil_cooldown "0"
    weapon_recoil_decay1_exp "99999"
    weapon_recoil_decay2_exp "99999"
    weapon_recoil_decay2_lin "99999"
    weapon_recoil_scale "0"
    weapon_recoil_suppression_shots "500"
    weapon_recoil_view_punch_extra 0
    sv_cheats 0 
    I hope you enjoyed my first plugin!
    PS: Sorry for my bad english -__- , im Portuguese

    Downloads:

    From Oficial Website (English Version)

    From Oficial Website (Portuguese Version)

    From Github

    From AlliedModders (Download Below)
    Attached Files
    File Type: zip English Version.zip (8.5 KB, 348 views)
    File Type: zip Portuguese Version.zip (8.6 KB, 187 views)

    Last edited by ShutUP99; 08-01-2018 at 05:39.
    ShutUP99 is offline
    headline
    SourceMod Moderator
    Join Date: Mar 2015
    Old 07-31-2018 , 18:17   Re: [CSGO] AlfaLoader - Config Executor
    Reply With Quote #2

    We have a translations system to prevent shipping different versions for different languages. You can read about it here. This is much preferred over shipping separate builds
    headline is offline
    ShutUP99
    Junior Member
    Join Date: Jan 2018
    Location: Portuguese
    Old 07-31-2018 , 18:24   Re: [CSGO] AlfaLoader - Config Executor
    Reply With Quote #3

    Quote:
    Originally Posted by Headline View Post
    We have a translations system to prevent shipping different versions for different languages. You can read about it here. This is much preferred over shipping separate builds
    Im new on the fórum and i am portuguese that's i didn't understand good what you say, But i think you said to me that i can't publish 2 versions in a post right? I need to remove it?
    ShutUP99 is offline
    headline
    SourceMod Moderator
    Join Date: Mar 2015
    Old 07-31-2018 , 18:32   Re: [CSGO] AlfaLoader - Config Executor
    Reply With Quote #4

    Quote:
    Originally Posted by ShutUP99 View Post
    Im new on the fórum and i am portuguese that's i didn't understand good what you say, But i think you said to me that i can't publish 2 versions in a post right? I need to remove it?
    You can have 2 versions, but we have a system built in SourceMod so you don't have to.
    headline is offline
    _Black_Yuzia_
    Member
    Join Date: Oct 2017
    Old 07-31-2018 , 18:34   Re: [CSGO] AlfaLoader - Config Executor
    Reply With Quote #5

    Quote:
    Originally Posted by ShutUP99 View Post
    But i think you said to me that i can't publish 2 versions in a post right? I need to remove it?
    No, he don't mean that.
    He say some like a "You don't need publish 2 version with 2 lang. You can use functions of SM and add both lang in one.
    _Black_Yuzia_ is offline
    ShutUP99
    Junior Member
    Join Date: Jan 2018
    Location: Portuguese
    Old 07-31-2018 , 18:37   Re: [CSGO] AlfaLoader - Config Executor
    Reply With Quote #6

    Quote:
    Originally Posted by _Black_Yuzia_ View Post
    No, he don't mean that.
    He say some like a "You don't need publish 2 version with 2 lang. You can use functions of SM and add both lang in one.
    I'm very beginner, i need to learn more about sourcepawn to do this xD My friend learned me how to code and i started doing plugins!

    Thanks for the tip!
    ShutUP99 is offline
    SnowHP
    Senior Member
    Join Date: Sep 2016
    Location: Porto, Portugal
    Old 07-31-2018 , 18:48   Re: [CSGO] AlfaLoader - Config Executor
    Reply With Quote #7

    Good work! Bom trabalho!
    __________________
    SnowHP is offline
    ShutUP99
    Junior Member
    Join Date: Jan 2018
    Location: Portuguese
    Old 08-01-2018 , 05:01   Re: [CSGO] AlfaLoader - Config Executor
    Reply With Quote #8

    Quote:
    Originally Posted by SnowHP View Post
    Good work! Bom trabalho!
    Obrigado snow
    Boa sorte com a Panthers!
    ShutUP99 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 04:29.


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