Raised This Month: $ Target: $400
 0% 

Hooking an entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MockingBird
Member
Join Date: Mar 2005
Old 10-01-2009 , 04:38   Re: Hooking an entity
Reply With Quote #3

Wow, cant believe I missed that lol...

anyway I am now having an issue with the callback not being run.

PHP Code:
HookEntities()
{
    new 
dungbell EntRefToEntIndex(FindEnt("logic_relay""dungbellxp"))
    
HookSingleEntityOutput(dungbell"Trigger"DungBell)
    
PrintToServer("Dungbell: %i"dungbell)
}

FindEnt(const String:classname[], const String:name[])
{
    new 
ent = -1;
    while(
true)
    {
        
ent FindEntityByClassname(entclassname)
        if(
ent == -1) break
        
        new 
String:entName[65]
        
GetEntityTargetName(ententNamesizeof(entName))
        
        if(
StrEqual(entNamename))
        {
            return 
ent;
        }
    }
}

public 
DungBell(const String:output[], calleractivatorFloat:delay)
{
    
PrintToChatAll("DungBell - Activator: %i"activator)
    if(
activator <= MaxPlayers && IsClientInGame(activator))
    {
        
RewardXP(activatorSKILL_STR10)
    }

I receive no error, and the entity hooked is '2064', which I assume is the correct ID.

My map setup:
trigger_multiple is activated, which calls 'Trigger' on a logic_relay called 'dungbellxp' which calls 'Trigger' on a logic_relay called 'XP'.

The last call is to create an output that can be hooked.

Any ideas why it isnt calling?

Thanks in advanced.

Last edited by MockingBird; 10-01-2009 at 04:52.
MockingBird is offline
 



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 18:20.


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