katoryje
Forum rules
Šiame forume galite siūlyti idėjas ar prašyti jums reikalingų pluginų. Jei kas nors pradės jį kurti, tai pasirašys Jūsų sukurtoje temoje. Niekada nepykite, jei niekas neatsako į Jūsų prašymą. Gal tai tiesiog per sudėtinga, arba reikalauja per daug darbo.
Šiame forume galite siūlyti idėjas ar prašyti jums reikalingų pluginų. Jei kas nors pradės jį kurti, tai pasirašys Jūsų sukurtoje temoje. Niekada nepykite, jei niekas neatsako į Jūsų prašymą. Gal tai tiesiog per sudėtinga, arba reikalauja per daug darbo.
- psychical
- Viršininkas
- Posts: 2094
- Joined: 2011 Mar 12 22:19
- Skype: tautvydas11
- Location: Linksmakalnis
- Contact:
Re: jail_open
Netrauksiu, geriau duosiu kita:
Bandyk jail_dust, jei neveiks, parasyk... Jei veiks, tai veiks beveik visuose map, kuriuose mygtukas arciau kameru o ne uz puskilometrio...
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}
- Attachments
-
jail_open.sma
- (1.75 KiB) Downloaded 757 times
Last edited by psychical on 2011 Jun 25 19:26, edited 2 times in total.
- psychical
- Viršininkas
- Posts: 2094
- Joined: 2011 Mar 12 22:19
- Skype: tautvydas11
- Location: Linksmakalnis
- Contact:
Re: jail_open
Srr mano klaida, istryniau include, galvojau jog nereik...
Edited, turi veikt...

- psychical
- Viršininkas
- Posts: 2094
- Joined: 2011 Mar 12 22:19
- Skype: tautvydas11
- Location: Linksmakalnis
- Contact:
Re: jail_open
ten speju bus kitaip padaryta, kad tipo jei tas map spaustu ta mygtuka ir t.t.
-
- Gana aktyvus vartotojas
- Posts: 445
- Joined: 2011 Aug 27 09:29
Re: jail_open
Įmanoma šitą vietą kodo
šitą: įkišti kur nors, bet ne į precache? Nes man dėl jo pjaunasi kitas pluginas ir nepajungia map.
Code: Select all
public plugin_precache(){ g_CellManagers = TrieCreate()}
Code: Select all
g_CellManagers = TrieCreate()
Re: jail_open
Gali kur nori.Pukuotukas951 wrote:Įmanoma šitą vietą kodo
šitą:Code: Select all
public plugin_precache(){ g_CellManagers = TrieCreate()}
įkišti kur nors, bet ne į precache? Nes man dėl jo pjaunasi kitas pluginas ir nepajungia map.Code: Select all
g_CellManagers = TrieCreate()
Re: katoryje
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;}
Who is online
Users browsing this forum: No registered users and 3 guests