Wargod Plugins

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
43
Реакции
0
Hello, please can you help me somebody to make open menu to choose player, because i need to write nick in console if i have with menu its more simple when i write /scan and /clean. Thank you very much if somebody can help me
Код:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Wargods"
#define VERSION "1.1"
#define AUTHOR "EXXF"

#define TAG "WarGods"

#define MOTD_LOCATION "addons/amxmodx/configs/wargod.html"

new const REASON_BAN[] = "No WG";

new bool:hascan[33], cvars[3]
new store_team

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd("say", "cmd_say")
    register_clcmd("say_team", "cmd_say")

    cvars[0] = register_cvar("wcd_disconnect_ban", "1")
    cvars[1] = register_cvar("wcd_minim_acces_flag", "d") // kick acces
    cvars[2] = register_cvar("wcd_time_for_ban", "2")

    register_dictionary("wargods.txt")
}

public client_connect(id)
{
    hascan[id] = false
}

public client_disconnect(id)
{
    if(hascan[id] && get_pcvar_num(cvars[0]) == 1)
    {
        new sName[32];
        get_user_name(id, sName, charsmax(sName));
    
        hascan[id] = false
        client_cmd(0, "spk ^"vox/bizwarn eliminated")
        server_cmd("amx_ban %i %s %s", get_pcvar_num(cvars[2]), sName, REASON_BAN)
    }
}


public cmd_say(id)
{
    new szSaid[192]
    read_args(szSaid, charsmax(szSaid))
    remove_quotes(szSaid)

    if(contain(szSaid, "/scan") != -1)
    {
        if(get_user_flags(id) & get_pcvar_flags(cvars[1]))
        {
            new target[32]
            copy(target, sizeof(target) -1, szSaid[6])
            new player = cmd_target(id, target, 2)

            if(player)
            {
                new pname[32], admin[32]
                get_user_name(player, pname, charsmax(pname))
                get_user_name(id, admin, charsmax(admin))

                if(hascan[player])
                {
                    ColorChat(id, "%L", LANG_SERVER, "ALREADY_HAVE", TAG)
                    return PLUGIN_HANDLED
                }
                else
                {
                    new timer[64]
                    get_time("%d/%m/%Y - %H:%M:%S", timer, charsmax(timer))
                    hascan[player] = true
                    store_team = get_user_team(player)
                    user_silentkill(player)
                    cs_set_user_team(player, CS_TEAM_SPECTATOR)

                    ColorChat(0, "%L", LANG_SERVER, "MAKE_WCD", TAG, admin, pname, timer)
                    ColorChat(0, "%L", LANG_SERVER, "DOWNLOAD_LINK", TAG)
                    ColorChat(0, "%L", LANG_SERVER, "INFO_WCD", TAG)
                    client_cmd(id, "snapshot")
                    return PLUGIN_CONTINUE
                }
            }
            else
            {
                ColorChat(id, "%L", LANG_SERVER, "INVALID_PLAYER", TAG)
                return PLUGIN_HANDLED
            }
        }
    }
    else if(contain(szSaid, "/clean") != -1)
    {
        if(get_user_flags(id) & get_pcvar_flags(cvars[1]))
        {
            new target[32]
            copy(target, charsmax(target), szSaid[7])
            new player = cmd_target(id, target, 2)

            if(player)
            {
                new pname[32]
                get_user_name(player, pname, charsmax(pname))
                cs_set_user_team(player, store_team)
                hascan[player] = false

                ColorChat(0, "%L", LANG_SERVER, "PLAYER_CLEAN", TAG, pname)
                return PLUGIN_CONTINUE
            }
            else
            {
                ColorChat(id, "%L", LANG_SERVER, "INVALID_PLAYER", TAG)
                return PLUGIN_HANDLED
            }
        }
    }
    else if(equal(szSaid, "/wg") || equal(szSaid, "/wargod"))
    {
        show_motd(id, MOTD_LOCATION)
    }

    return PLUGIN_CONTINUE
}

stock ColorChat(const id, const input[], any:...)
{
    new Count = 1, Players[32];
    static Msg[191];
    vformat(Msg, 190, input, 3);

    replace_all(Msg, 190, "!g", "^4");
    replace_all(Msg, 190, "!y", "^1");
    replace_all(Msg, 190, "!t", "^3");

    if(id) Players[0] = id; else get_players(Players, Count, "ch");
    {
        for (new i = 0; i < Count; i++)
        {
            if (is_user_connected(Players[i]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Players[i]);
                write_byte(Players[i]);
                write_string(Msg);
                message_end();
            }
        }
    }
    return PLUGIN_HANDLED
}
 
Сообщения
1,082
Реакции
58
Помог
11 раз(а)
Флаг доступа смени
17 Ноя 2023
Не правильно перевел, если я не ошибаюсь, есть данный плагин на просторах интернета через меню
 
Последнее редактирование:
Сообщения
18
Реакции
0
Помог
1 раз(а)
try this

Код:
#include <amxmodx> 
#include <cstrike>
#include <fakemeta_util>

#define PLUGIN "Cerere wCD"
#define VERSION "1.1"
#define AUTHOR "DanN / LiOn"  
 
#define TAG "WCD"
#define MOTD_LOCATION "addons/amxmodx/configs/wargod.html"

new bool:hascan[33], cvars[2]
new store_team

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd("say /wcd", "scan_motd")
    register_clcmd("say_team /wcd", "scan_motd")

    register_clcmd("say /infowcd", "scan_motd")
    register_clcmd("say_team /infowcd", "scan_motd")
 

    register_clcmd("say /scan", "scan_clean_menu")
    register_clcmd("say_team /scan", "scan_clean_menu")

    cvars[0] = register_cvar("wcd_disconnect_ban", "1")
    cvars[1] = register_cvar("wcd_ban_time", "20160")

    register_forward(FM_ClientDisconnect, "fw_ClientDisconnect")
}
 
public client_connect(id)
{
    hascan[id] = false
}
 
public fw_ClientDisconnect(id)
{
    if(hascan[id] && get_pcvar_num(cvars[0]) == 1)
    {
        new ip[32]
        get_user_ip(id, ip, charsmax(ip), 1)

        hascan[id] = false
        server_print("%s", ip)
        client_cmd(0, "spk ^"vox/bizwarn eliminated") 
        server_cmd("kick #%d ^"You have been banned for %d mn^"; wait; addip ^"%d^" ^"%s^"; wait; writeid", get_user_userid(id), get_pcvar_num(cvars[1]), get_pcvar_num(cvars[1]), ip)
        server_exec()
    }
}

public scan_clean_menu(id)
{
    if(get_user_flags(id) & ADMIN_CHAT)
    {
        new iMenu = menu_create("\rScan & clean \w:", "scan_clean_menu_handler")

        menu_additem(iMenu, "\wScan menu")
        menu_additem(iMenu, "\wClean menu")
    
        menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
        menu_display(id, iMenu, 0)
        }
        else
    {
        ColorChat(id, "!gMessage !y: You have no access for this command.")
        }
        return PLUGIN_CONTINUE
}

public scan_clean_menu_handler(id, iMenu, iItem)
{
    switch (iItem)
    {
        case 0:
        {
            scanmenu(id)
        }
        case 1:
        {
            cleanmenu(id)
        }
    }
    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}

public scanmenu(id)
{
    static amenu[512]
    formatex(amenu,charsmax(amenu),"\rPlayers list^n\dChoose Target to scan\w:")
    new menuz = menu_create(amenu,"scan_menu")

    new players[32], tempid, pnum
    new szName[32], szTempid[10]
    get_players(players, pnum)
         
    for(new i; i < pnum; i++)
    {
        tempid = players[i]
        if(is_user_connected(tempid) && !is_user_bot(tempid))
        {
            get_user_name(tempid, szName, 31)
            num_to_str(tempid, szTempid, 9)
            formatex(amenu, charsmax(amenu), "\w%s", szName)
            menu_additem(menuz, amenu, szTempid)
        }
    }
    menu_setprop(menuz,MPROP_EXIT,MEXIT_ALL)
    menu_display(id,menuz,0)
}

public scan_menu(id,menu,item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }

    new access,callback,data[6],iname[64]
    menu_item_getinfo(menu,item,access,data,5,iname,63,callback)
    new tempid = str_to_num(data)
    player_scan_menu(id, tempid)
    menu_destroy(menu)
    return PLUGIN_HANDLED
}

public player_scan_menu(id, player) 
{
    new pname[32], admin[32]
    get_user_name(player, pname, charsmax(pname))
    get_user_name(id, admin, charsmax(admin))
 
    if(hascan[player])
    {
        ColorChat(id, "!y[!g%s!y] !tYou already requested a scan for this player!", TAG)
        return PLUGIN_HANDLED
    }
    else
    {
        new timer[64]
        get_time("%d/%m/%Y - %H:%M:%S", timer, charsmax(timer))
        hascan[player] = true
        store_team = get_user_team(player)
        user_silentkill(player)
        cs_set_user_team(player, CS_TEAM_SPECTATOR)
        ColorChat(0, "!y[!g%s!y] !tAdmin !g%s !trequests an WCD scan for player !g%s !y- !tDate: !g%s", TAG, admin, pname, timer)
        ColorChat(0, "!y[!g%s!y] !tDownload link !gwww.wargods.ro/wcd/download.php", TAG)
        ColorChat(0, "!y[!g%s!y] !tIf you don't know how to do an WCD scan, type in chat !g/wcd !tor !g/infowcd!y!", TAG)
        return PLUGIN_CONTINUE
    }
}
 
public cleanmenu(id)
{
    static amenu[512]
    formatex(amenu,charsmax(amenu),"\rPlayers list^n\dChoose Target to clean\w:")
    new menuz = menu_create(amenu,"clean_menu")
        
    new players[32], tempid, pnum
    new szName[32], szTempid[10]
    get_players(players, pnum)
        
    for(new i; i < pnum; i++)
    {
        tempid = players[i]
        if(is_user_connected(tempid) && !is_user_bot(tempid))
        {
            get_user_name(tempid, szName, 31)
            num_to_str(tempid, szTempid, 9)
            formatex(amenu, charsmax(amenu), "\w%s", szName)
            menu_additem(menuz, amenu, szTempid)
        }
    }
    menu_setprop(menuz,MPROP_EXIT,MEXIT_ALL)
    menu_display(id,menuz,0)
}

public clean_menu(id,menu,item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    new access,callback,data[6],iname[64]
    menu_item_getinfo(menu,item,access,data,5,iname,63,callback)
    new tempid = str_to_num(data)
    player_clean_menu(id, tempid)
    menu_destroy(menu)
    return PLUGIN_HANDLED
}

public player_clean_menu(id, player)
{
    if(get_user_flags(id) & get_pcvar_flags(cvars[1]))
    {
        new pname[32]
        get_user_name(player, pname, charsmax(pname))
        cs_set_user_team(player, store_team)
        hascan[player] = false
        remove_task(player)
        ColorChat(0, "!y[!g%s!y] !tThe player !g%s !tis clean after WCD scan!y!", TAG, pname)
        return PLUGIN_CONTINUE
    }  
    else
    {
        ColorChat(id, "!y[!g%s!y] !tThe specified player is inexistent!y!", TAG)
        return PLUGIN_HANDLED
    }
}

public scan_motd(id)
{
    show_motd(id, MOTD_LOCATION)
}

stock ColorChat(const id, const input[], any:...)
{
    new Count = 1, Players[32];
    static Msg[191];
    vformat(Msg, 190, input, 3);
 
    replace_all(Msg, 190, "!g", "^4");
    replace_all(Msg, 190, "!y", "^1");
    replace_all(Msg, 190, "!t", "^3");
 
    if(id) Players[0] = id; else get_players(Players, Count, "ch");
    {
        for (new i = 0; i < Count; i++)
        {
            if (is_user_connected(Players[i]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Players[i]);
                write_byte(Players[i]);
                write_string(Msg);
                message_end();
            }
        }
    }
    return PLUGIN_HANDLED
}
 
Последнее редактирование модератором:
Статус
В этой теме нельзя размещать новые ответы.

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

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