Page 1 of 1

katoryje

Posted: 2011 Jun 25 16:02
by KamiN
reik man kažko

Re: jail_open

Posted: 2011 Jun 25 16:30
by psychical
Netrauksiu, geriau duosiu kita:

Code: Select all

 #include <amxmodx>#include <hamsandwich>#include <engine>#include <cstrike>#include <fakemeta>#include <amxmisc> #define CELL_RADIUS Float:500.0 new g_Buttons[10], Trie:g_CellManagers public plugin_precache(){    g_CellManagers = TrieCreate()} public plugin_init(){    register_plugin("JailBreak: daysmenu", "0.1", "rez.lt")    register_clcmd("say /open", "jail_open");    setup_buttons()} public jail_open(){    static i    for(i = 0; i < sizeof(g_Buttons); i++)    {        if(g_Buttons[i])        {            ExecuteHamB(Ham_Use, g_Buttons[i], 0, 0, 1, 1.0)            entity_set_float(g_Buttons[i], EV_FL_frame, 0.0)        }    }} public setup_buttons(){    new ent[3]    new Float:origin[3]    new info[32]    new pos        while((pos <= sizeof(g_Buttons)) && (ent[0] = engfunc(EngFunc_FindEntityByString, ent[0], "classname", "info_player_deathmatch")))    {        pev(ent[0], pev_origin, origin)        while((ent[1] = engfunc(EngFunc_FindEntityInSphere, ent[1], origin, CELL_RADIUS)))        {            if(!is_valid_ent(ent[1]))                continue                        entity_get_string(ent[1], EV_SZ_classname, info, charsmax(info))            if(!equal(info, "func_door"))                continue                        entity_get_string(ent[1], EV_SZ_targetname, info, charsmax(info))            if(!info[0])                continue                        if(TrieKeyExists(g_CellManagers, info))            {                TrieGetCell(g_CellManagers, info, ent[2])            }            else            {                ent[2] = engfunc(EngFunc_FindEntityByString, 0, "target", info)            }                        if(is_valid_ent(ent[2]) && (in_array(ent[2], g_Buttons, sizeof(g_Buttons)) < 0))            {                g_Buttons[pos] = ent[2]                pos++                break            }        }    }    TrieDestroy(g_CellManagers)} stock in_array(needle, data[], size){    for(new i = 0; i < size; i++)    {        if(data[i] == needle)            return i    }    return -1}
Bandyk jail_dust, jei neveiks, parasyk... Jei veiks, tai veiks beveik visuose map, kuriuose mygtukas arciau kameru o ne uz puskilometrio...

Re: jail_open

Posted: 2011 Jun 25 18:57
by KamiN
dekui

Re: jail_open

Posted: 2011 Jun 25 19:25
by psychical
Srr mano klaida, istryniau include, galvojau jog nereik... :D Edited, turi veikt...

Re: jail_open

Posted: 2011 Jun 25 21:02
by KamiN
aciu

Re: jail_open

Posted: 2011 Jun 25 22:24
by psychical
ten speju bus kitaip padaryta, kad tipo jei tas map spaustu ta mygtuka ir t.t.

Re: jail_open

Posted: 2012 May 24 16:53
by Pukuotukas951
Įmanoma šitą vietą kodo

Code: Select all

public plugin_precache(){    g_CellManagers = TrieCreate()}
šitą:

Code: Select all

    g_CellManagers = TrieCreate()
įkišti kur nors, bet ne į precache? Nes man dėl jo pjaunasi kitas pluginas ir nepajungia map.

Re: jail_open

Posted: 2012 May 26 10:09
by Fly3r
Pukuotukas951 wrote:Įmanoma šitą vietą kodo

Code: Select all

public plugin_precache(){    g_CellManagers = TrieCreate()}
šitą:

Code: Select all

    g_CellManagers = TrieCreate()
įkišti kur nors, bet ne į precache? Nes man dėl jo pjaunasi kitas pluginas ir nepajungia map.
Gali kur nori.

Re: katoryje

Posted: 2012 May 26 11:01
by hleV
Mano toks variantas. Norint atidaryt kameras reikia panaudot OpenCells().

Code: Select all

#define MAX_BUTTONS 32#define CELL_RADIUS 200.0 new Buttons[MAX_BUTTONS];new ButtonCount; public plugin_init()    GatherButtons(); GatherButtons(){    new spawn, door, target, Float:origin[3], className[32], i;     while (ButtonCount < sizeof Buttons && (spawn = find_ent_by_class(spawn, "info_player_deathmatch")))    {        entity_get_vector(spawn, EV_VEC_origin, origin);         while ((door = find_ent_in_sphere(door, origin, CELL_RADIUS)))        {            entity_get_string(door, EV_SZ_classname, className, charsmax(className));             if (!equal(className, "func_door"))                continue;             entity_get_string(door, EV_SZ_targetname, className, charsmax(className));             if (className[0] == EOS)                continue;             target = find_ent_by_target(0, className);             if (!target)                continue;             for (i = 0; i < ButtonCount; i++)                if (target == Buttons[i])                    continue;             Buttons[ButtonCount++] = target;             break;        }         door = 0;    }} OpenCells(){    for (new i, ent; i < ButtonCount; i++)    {        ent = Buttons[i];         ExecuteHamB(Ham_Use, ent, 0, 0, 1, 1.0);        entity_set_float(ent, EV_FL_frame, 0.0);    }     CellsOpened = true;}