Поиск Plugin which could comment plugins-*.ini

Сообщения
282
Реакции
34
Помог
3 раз(а)
Currently I'm using hobo_crontab to do change inside plugins.ini
Is there any plugin which would comment ";"(rename) plugins-*.ini file per our choice and uncomment another plugins.ini file?

This could bring double modes on server much easier.
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
Последнее редактирование:
Сообщения
282
Реакции
34
Помог
3 раз(а)
ChatGPT helped a bit, code looks like this:

Код:
#include <amxmodx>

#define PLUGIN_NAME "FileRenamer"

public plugin_init()
{
    register_plugin(PLUGIN_NAME, "1.0", "Your Name");
    
    register_clcmd("rename_configs_file", "RenameConfigsFileCmd");
    register_clcmd("restore_configs_file", "RestoreConfigsFileCmd");
}

public RenameConfigsFileCmd(id)
{
    new oldFileName[PLATFORM_MAX_PATH], newFileName[PLATFORM_MAX_PATH];

    format(oldFileName, sizeof(oldFileName) - 1, "addons/amxmodx/configs/plugins.ini");
    format(newFileName, sizeof(newFileName) - 1, "addons/amxmodx/configs/;plugins.ini");

    if (rename_file(oldFileName, newFileName, 1))
    {
        client_print(id, print_chat, "File renamed successfully.");
    }
    else
    {
        client_print(id, print_chat, "Failed to rename file.");
    }
}

public RestoreConfigsFileCmd(id)
{
    new oldFileName[PLATFORM_MAX_PATH], newFileName[PLATFORM_MAX_PATH];

    format(oldFileName, sizeof(oldFileName) - 1, "addons/amxmodx/configs/;plugins.ini");
    format(newFileName, sizeof(newFileName) - 1, "addons/amxmodx/configs/plugins.ini");

    if (rename_file(oldFileName, newFileName, 1))
    {
        client_print(id, print_chat, "File name restored successfully.");
    }
    else
    {
        client_print(id, print_chat, "Failed to restore file name.");
    }
}
Now to call it in crontab and practically it should work.
Unfortunatelly, I could explain to chatgpt to make functional "timer'😁
But for real, chatgpt seems awesome.
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу