Page 1 of 1

Biški pataisyti pluginą

Posted: 2013 Sep 11 14:26
by Play4FREE
Reikia padaryti kad su /open komanda būtų galima atidaryti visas duris, ir kad per vidurį rašytų: Prižiurėtojas Nereklamuok atidarė kameras...

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", "fwz.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}

Re: Biški pataisyti pluginą

Posted: 2013 Sep 11 15:17
by xFrostas

Code: Select all

#define CELL_RADIUS Float:500.0
>>>

Code: Select all

#define CELL_RADIUS Float:9999.9
O dėl name tai jail_open() >>> jail_open(id) ir įsidėk

Code: Select all

        new Name[32]        get_user_name(id, Name, 31)         set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 4.0, 0.0, 0.0, -1)        show_hudmessage(0, "Priziuretojas %s atidare kameras...", Name)

Re: Biški pataisyti pluginą

Posted: 2013 Sep 11 15:53
by Play4FREE
Jeigu gali pabandyk tu, nes man nesigauna ir meta error :/

Re: Biški pataisyti pluginą

Posted: 2013 Sep 11 16:28
by xFrostas
Derinukas labai paprastas, tik puf ir įdedi.

Code: Select all

#include <amxmodx>#include <hamsandwich>#include <engine>#include <cstrike>#include <fakemeta>#include <amxmisc> #define CELL_RADIUS Float: 5000.0 new g_Buttons[10], Trie: g_CellManagers public plugin_precache(){    g_CellManagers = TrieCreate()} public plugin_init(){    register_plugin("JailBreak: daysmenu", "0.1", "fwz.lt")     register_clcmd("say /open", "jail_open")     setup_buttons()} public jail_open(id){    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)        }    }        new Name[32]    get_user_name(id, Name, 31)     set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 4.0, 0.0, 0.0, -1)    show_hudmessage(0, "Priziuretojas %s atidare kameras...", Name)} 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}

Re: Biški pataisyti pluginą

Posted: 2013 Sep 11 17:22
by Play4FREE
Dq viskas veikia ;]