Udalo mi sie takie cos wykombinowac
tylko ze otwiera raz cele, a ja chcialbym aby sie otwieraly/zamykaly.
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <fun>
#define PLUGIN "Otworz Cele"
#define VERSION "1.0"
#define AUTHOR "Pittero"
new found[10]
public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /cele", "Push_Button");
}
public Push_Button()
{
new ent = 1
new ent3
new Float:origin[3]
new Float:radius = 200.0
new class[32]
new name[32]
new pos
while((pos <= sizeof(found)) && (ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "info_player_deathmatch")))
{
new ent2 = 1
pev(ent, pev_origin, origin)
while((ent2 = engfunc(EngFunc_FindEntityInSphere, ent2, origin, radius)))
{
if(!pev_valid(ent2))
continue
pev(ent2, pev_classname, class, charsmax(class))
if(!equal(class, "func_door"))
continue
pev(ent2, pev_targetname, name, charsmax(name))
ent3 = engfunc(EngFunc_FindEntityByString, 0, "target", name)
if(pev_valid(ent3) && (in_array(ent3, found, sizeof(found)) < 0))
{
ExecuteHamB(Ham_Use, ent3, 0, 0, 1, 1.0)
found[pos] = ent3
pos++
break
}
}
}
return pos
}
stock in_array(needle, data[], size)
{
for(new i = 0; i < size; i++)
{
if(data[i] == needle)
return i
}
return -1
}
Użytkownik Pittero edytował ten post 29.08.2010 14:29