Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[CSGO] AlfaLoader - Config Executor


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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 enjoy you liked my first plugin!
PS: Sorry for my bad english -__- , im Portuguese :3

Downloads:

From Oficial Website (English Version)

From Oficial Website (Portuguese Version)

From Github (SOON)

From AlliedModders (Download Below)

Attached Files
File Type: zip English Version.zip (8.5 KB)
File Type: zip Portuguese Version.zip (8.6 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

  • 1 rok później...

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...