sv_password

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
please help me finish this lil plugin... i`m newbie and dont know so much :(

C++:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
public plugin_init( ) {
    register_plugin( "Protect SRV PASS", "1.0", "Shadowless" );
    register_clcmd("sv_password", "passprotect");
    register_concmd("sv_password", "passprotect", ADMIN_IMMUNITY, "Protect Server Password" );
    register_srvcmd("sv_password","passprotect");
}
public passprotect(id)
{
    if (!(get_user_flags(id) & ADMIN_LEVEL_H))
    {
        console_print(id,"Notice: Only Server Owner Can Set Server Password")
        client_print(0,print_chat,"Notice: Only Server Owner Can Set Server Password")
        server_cmd("sv_password ^"^"")
    }
    return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
 

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
C++:
/*
Plugin generated by AMXX-Studio
Credits To OLO for "Admin Commands"
*/
#include <amxmodx>
#define SUPERADMIN ADMIN_LEVEL_H
new const g_cvarguardCFG[] = "addons/amxmodx/configs/cvarguard.cfg"
public plugin_init()
{
    register_plugin("CVAR GUARD","1.1","Shadowless")
    register_clcmd("amx_cvar","amxcvarguard",ADMIN_CVAR,"amx_cvar < cvar > < value >")
    register_concmd("amx_cvar", "amxcvarguard", ADMIN_CVAR, "amx_cvar <cvar> [value]")
    set_task(5.0,"amx_simplecvarguard");
}
public amx_simplecvarguard(id)
{
    server_cmd("exec %s", g_cvarguardCFG)
    return PLUGIN_HANDLED
}
public plugin_precache()
{
    if(!file_exists(g_cvarguardCFG))
    {
        write_file(g_cvarguardCFG, ";//CVAR GUARD configuration file^n")
        write_file(g_cvarguardCFG, "sv_password ^"^"")
        write_file(g_cvarguardCFG, "mp_freezetime ^"0^"")
        write_file(g_cvarguardCFG, "mp_friendlyfire ^"0^"")
        write_file(g_cvarguardCFG, "mp_timelimit ^"30^"")
        write_file(g_cvarguardCFG, "mp_startmoney ^"1300^"")
    }
}
public amxcvarguard(id)
{
    if (!(get_user_flags(id) & ADMIN_CVAR)){
        client_print(id,print_console,"[AMXX] You have no access to that command")
        return PLUGIN_HANDLED
    }
    if ((get_user_flags(id) & ADMIN_CVAR)){
        if (read_argc() < 3){
            client_print(id,print_console,"[AMXX] Usage: amx_cvar < cvar > < value >")
            return PLUGIN_HANDLED
        }
    }
    new arg[32], arg2[64]
    read_argv(1,arg,32)
    read_argv(2,arg2,64)
    if (cvar_exists(arg)){
        
        if (equal(arg,"csstats_reset") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }
        if (equal(arg,"sv_password") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }
        if (equal(arg,"mp_freezetime") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }
        if (equal(arg,"mp_friendlyfire") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }
        if (equal(arg,"mp_timelimit") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }       
        if (equal(arg,"mp_startmoney") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }           
        if (equal(arg,"sv_airaccelerate") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }           
        if (equal(arg,"sv_restart") && !(get_user_flags(id) & SUPERADMIN)){
            client_print(id,print_console,"[AMXX] You have no access to that cvar")
            return PLUGIN_HANDLED
        }   
        set_cvar_string(arg,arg2);
        client_print(id,print_console,"[AMXX] Cvar ^"%s^" changed to ^"%s^"",arg,arg2)
    }
    else{
        client_print(id,print_console,"[AMXX] Unknown cvar")
    }
    return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
 
Сверху Снизу