Raised This Month: $ Target: $400
 0% 

ExecuteHamB


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KamiN
Senior Member
Join Date: Jun 2011
Old 06-25-2011 , 13:15   ExecuteHamB
Reply With Quote #1

This line has no effect, why?
Code:
ExecuteHamB(Ham_Use, g_Buttons[i], 0, 0, 1, 1.0)
Code:
#include <amxmodx>
#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("something", "0.1", "somebody")
    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
}
KamiN is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 06-25-2011 , 13:28   Re: ExecuteHamB
Reply With Quote #2

#include <hamsandwich> at the top
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode