BANNED
Join Date: Feb 2011
Location: Espaņa
|
09-12-2011
, 18:24
Problema Abrir Celdas JailBreak No se abren
|
#1
|
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
new const VERSION[] = "1.6"
new found[10]
public plugin_init()
{
register_plugin( "Auto Cells Opener", VERSION, "Wrecked" )
register_clcmd( "say /abrir", "CMD_PushButton")
}
public CMD_PushButton( id )
{
if ( cs_get_user_team (id) == CS_TEAM_CT )
{
new name [ 32 ]
get_user_name ( id , name , 31 )
ChatColor ( 0 , "!t[!gJailBreak!t] !nEl Policia !g%s !nA Abierto Las Celdas De Los Presos" , name)
Push_Button()
}
else if ( get_user_flags(id) & ADMIN_KICK )
{
Push_Button()
new name [ 32 ]
get_user_name ( id , name , 31 )
ChatColor ( 0 , "!t[!gJailBreak!t] !nEl Administrador !g%s !nA Abierto Las Celdas De Los Presos" , name)
}
return PLUGIN_HANDLED
}
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"))) // info_player_deathmatch = tspawn
{
new ent2 = 1
pev(ent, pev_origin, origin)
while((ent2 = engfunc(EngFunc_FindEntityInSphere, ent2, origin, radius))) // find doors near T spawn
{
if(!pev_valid(ent2))
continue
pev(ent2, pev_classname, class, charsmax(class))
if(!equal(class, "func_door")) // if it's not a door, move on to the next iteration
continue
pev(ent2, pev_targetname, name, charsmax(name))
ent3 = engfunc(EngFunc_FindEntityByString, 0, "target", name) // find button that opens this door
if(pev_valid(ent3) && (in_array(ent3, found, sizeof(found)) < 0))
{
ExecuteHamB(Ham_Use, ent3, 0, 0, 1, 1.0) // zomg poosh it
found[pos] = ent3
pos++ // next
break // break from current while loop
}
}
}
return pos
}
stock in_array(needle, data[], size)
{
for(new i = 0; i < size; i++)
{
if(data[i] == needle)
return i
}
return -1
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!n", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
Al escribir /abrir , si se manda el mensaje , pero no abre las puertas. Antes hice uno que si funciono a medias , solo le abrian a los admins.
Ahora no funciona
|
|