Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Przenoszenie zywych graczy bez zabijania


  • Zamknięty Temat jest zamknięty
1 odpowiedź w tym temacie

#1 starsky

    Profesjonalista

  • Użytkownik

Reputacja: 3
Nowy

  • Postów:178
  • GG:
  • Lokalizacja:v_v
Offline

Napisano 04.12.2009 19:48

Witam,
czy istnieje taka modyfikacja która umiżliwia prznoszenie graczy przez amxmodmenu aby ich nie zabijało?
  • +
  • -
  • 0

#2 honey

    Wszechmogący

  • Zbanowany

Reputacja: 124
Zaawansowany

  • Postów:606
  • Steam:steam
  • Lokalizacja:n / a
Offline

Napisano 04.12.2009 19:56

/*    Autor: grankee
*   Plugin pisany z myslą o tych, którzy giną przy przenoszeniu do drugiej drużyny przez admina <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/wink.gif' class='bbc_emoticon' alt=';)' />
*   W przypadku gdy admin przenosi żywego gracza do drugiej drużyny jest on zabijany.
*   Ten plugin sprawia, że przenoszony gracz pojawia sie na respie drużyny, do której został przeniesiony
*   (lub zostaje w miejscu w przypadku amx_teammenuspawn=0)
*
*    Robiony na podstawie kody plmenu.sma
*
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>

/** skip autoloading since it's optional */
#define AMXMODX_NOAUTOLOAD
#include <cstrike>

new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33]
#define MAX_CLCMDS 24
new g_coloredMenus
new g_cstrike = 0

public plugin_natives()
{
    set_module_filter("module_filter")
    set_native_filter("native_filter")
}

public plugin_init()
{
    register_plugin("Teammenu nokill v4.0", "v4.0", "grankee")
    register_dictionary("common.txt")
    register_dictionary("admincmd.txt")
    register_dictionary("plmenu.txt")

   
    register_clcmd("amx_teammenu", "cmdTeamMenu", ADMIN_LEVEL_A, "- pokazuje menu druzyn")
    register_clcmd("teammenu", "cmdTeamMenu", ADMIN_LEVEL_A, "- pokazuje menu druzyn")
    register_cvar("amx_teammenuspawn", "1")
    register_menucmd(register_menuid("Team Menu"), 1023, "actionTeamMenu")
   

    g_coloredMenus = colored_menus()

   

    if (module_exists("cstrike"))
        g_cstrike = 1
}

public module_filter(const module[])
{
    if (equali(module, "cstrike"))
        return PLUGIN_HANDLED
   
    return PLUGIN_CONTINUE
}

public native_filter(const name[], index, trap)
{
    if (!trap)
        return PLUGIN_HANDLED
       
    return PLUGIN_CONTINUE
}





public actionTeamMenu(id, key)
{
//new teamname[32]
    switch (key)
    {
        case 7:
        {
            g_menuOption[id] = 1 - g_menuOption[id]
            displayTeamMenu(id, g_menuPosition[id])
        }
        case 8: displayTeamMenu(id, ++g_menuPosition[id])
        case 9: displayTeamMenu(id, --g_menuPosition[id])
        default:
        {
            new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
            new authid[32], authid2[32], name[32], name2[32]

            get_user_name(player, name2, 31)
            get_user_authid(id, authid, 31)
            get_user_authid(player, authid2, 31)
            get_user_name(id, name, 31)
               
            log_amx("Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2, g_menuOption[id] ? "TERRORIST" : "CT")
           
            if (get_cvar_num("amx_hideactivity")==1)
            {
                for (new a=1;a<=32;a++)
                {
                    if (is_user_connected(a))
                    {
                        if (get_user_flags(a) & ADMIN_RESERVATION)
                        {
                            client_print(a, print_chat, "%L", id, "ADMIN_TRANSF_2", name, name2, g_menuOption[id] ? "TERRORIST" : "CT")
                        }
           
                    }
                }
            }
            else
            {
                switch (get_cvar_num("amx_show_activity"))
                {
                    case 2: client_print(0, print_chat, "%L", id, "ADMIN_TRANSF_2", name, name2, g_menuOption[id] ? "TERRORIST" : "CT")
                    case 1: client_print(0, print_chat, "%L", id, "ADMIN_TRANSF_1", name2, g_menuOption[id] ? "TERRORIST" : "CT")
                }
            }

            if (g_cstrike)
            {
                if (is_user_alive(player))
                {
                    if(g_menuOption[id]==1)
                    {
                        cs_set_user_team(player, CS_TEAM_T)
                        if (get_cvar_num("amx_teammenuspawn") > 0)
                        spawn(player)
                       
                    }
                    else
                    {
                        cs_set_user_team(player, CS_TEAM_CT)
                        if (get_cvar_num("amx_teammenuspawn") > 0)
                        spawn(player)
                    }
                }
                else
                {
                    if(g_menuOption[id]==1)
                    {
                        cs_set_user_team(player, CS_TEAM_T)
                        cs_reset_user_model(player)   
                    }
                    else
                    {
                        cs_set_user_team(player, CS_TEAM_CT)
                        cs_reset_user_model(player)   
                    }
                }   
               
            }
               
            /*else
            {
                new limit_setting = get_cvar_num("mp_limitteams")
               
                set_cvar_num("mp_limitteams", 0)
                engclient_cmd(player, "jointeam", g_menuOption[id] ? "1" : "2")
                engclient_cmd(player, "joinclass", "1")
                set_cvar_num("mp_limitteams", limit_setting)
            }*/

            displayTeamMenu(id, g_menuPosition[id])
        }
    }
   
    return PLUGIN_HANDLED
}

displayTeamMenu(id, pos)
{
    if (pos < 0)
        return

    get_players(g_menuPlayers[id], g_menuPlayersNum[id])

    new menuBody[512]
    new b = 0
    new i, iteam
    new name[32], team[4]
    new start = pos * 7
    new ja[32]
    get_user_name (id, ja, 31)
    if (start >= g_menuPlayersNum[id])
        start = pos = g_menuPosition[id] = 0

    new len = format(menuBody, 511, g_coloredMenus ? "y%LR%d/%d^nw^n" : "%L %d/%d^n^n", id, "TEAM_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
    new end = start + 7
    new keys = MENU_KEY_0|MENU_KEY_8

    if (end > g_menuPlayersNum[id])
        end = g_menuPlayersNum[id]

    for (new a = start; a < end; ++a)
    {
        i = g_menuPlayers[id][a]
        get_user_name(i, name, 31)
       
        if (g_cstrike)
        {
            iteam = _:cs_get_user_team(i)
           
            if (iteam == 1)
            {
                copy(team, 3, "TE")
            }
            else if (iteam == 2)
            {
                copy(team, 3, "CT")
            } else {
                get_user_team(i, team, 3)
            }
        } else {
            iteam = get_user_team(i, team, 3)
        }

        if ((iteam == (g_menuOption[id] ? 1 : 2)) || (access(i, ADMIN_IMMUNITY)&&(i!=id)))
        {
            ++b
           
            if (g_coloredMenus)
                len += format(menuBody[len], 511-len, "d%d. %sR%s^nw", b, name, team)
            else
                len += format(menuBody[len], 511-len, "#. %s   %s^n", name, team)       
        } else {
            keys |= (1<<<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />
               
            if (is_user_admin(i))
                len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s r*yR%s^nw" : "%d. %s *   %s^n", ++b, name, team)
            else
                len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %syR%s^nw" : "%d. %s   %s^n", ++b, name, team)
        }
    }

    len += format(menuBody[len], 511-len, "^n8. %L^n", id, "TRANSF_TO", g_menuOption[id] ? "TERRORIST" : "CT")

    if (end != g_menuPlayersNum[id])
    {
        format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
        keys |= MENU_KEY_9
    }
    else
        format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
   
    show_menu(id, keys, menuBody, -1, "Team Menu")
}

public cmdTeamMenu(id, level, cid)
{
    if (!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED

    g_menuOption[id] = 0

    displayTeamMenu(id, g_menuPosition[id] = 0)

    return PLUGIN_HANDLED
}

Podobny temat: [ http://amxx.pl/topic... ... ght=nokill ]




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych