Raised This Month: $51 Target: $400
 12% 

Hooking Entities Issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MockingBird
Member
Join Date: Mar 2005
Old 10-24-2009 , 10:48   Hooking Entities Issue
Reply With Quote #1

Hey guys,

I have managed to hook entities so that they call back:
PHP Code:
HookEntities()
{
    new 
dungbell EntRefToEntIndex(FindEnt("logic_relay""dungbellxp"))
    
HookSingleEntityOutput(dungbell"OnTrigger"DungBell)
    new 
jump EntRefToEntIndex(FindEnt("logic_relay""jumpxp"))
    
HookSingleEntityOutput(jump"OnTrigger"Jump)
    
//new escape = FindEnt("logic_relay", "escapexp")
    //HookSingleEntityOutput(escape, "Trigger", Escape)
    
new running1 EntRefToEntIndex(FindEnt("logic_relay""runninghalf"))
    
HookSingleEntityOutput(running1"OnTrigger"Running1)
    new 
running2 EntRefToEntIndex(FindEnt("logic_relay""runningfull"))
    
HookSingleEntityOutput(running2"OnTrigger"Running2)
    new 
pool1 EntRefToEntIndex(FindEnt("logic_relay""poolhalf"))
    
HookSingleEntityOutput(pool1"OnTrigger"Pool1)
    new 
pool2 EntRefToEntIndex(FindEnt("logic_relay""poolfull"))
    
HookSingleEntityOutput(pool2"OnTrigger"Pool2)
    new 
poolcancel EntRefToEntIndex(FindEnt("logic_relay""poolcancel"))
    
HookSingleEntityOutput(poolcancel"OnTrigger"PoolCancel)
    new 
kick EntRefToEntIndex(FindEnt("logic_relay""kick"))
    
HookSingleEntityOutput(kick"OnTrigger"Kick)
    new 
metaldetector EntRefToEntIndex(FindEnt("logic_relay""metaldetector_check"))
    
HookSingleEntityOutput(metaldetector"OnTrigger"MetalDetector)

However, as soon as someone joins the server, all the hooks stop working. Im assuming that the new player offsets the entities, however I was under the impression that the server kept a buffer of MAX_PLAYERS before other entities started in order to cater for that.. is this different with logic entities?

Or perhaps this is just an issue with the HookSingleEntityOutput function?

Does anyone know a way to fix this? For now, I will just hack and unhook all the previous entities and rehook them again using the EntRefs.

Thanks.
MockingBird is offline
MockingBird
Member
Join Date: Mar 2005
Old 11-12-2009 , 03:35   Re: Hooking Entities Issue
Reply With Quote #2

I am still having this problem.

Shameless self-bump.
MockingBird is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 11-12-2009 , 06:22   Re: Hooking Entities Issue
Reply With Quote #3

See: https://bugs.alliedmods.net/show_bug.cgi?id=3988

Fixed in Revision 2834
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
MockingBird
Member
Join Date: Mar 2005
Old 11-12-2009 , 07:28   Re: Hooking Entities Issue
Reply With Quote #4

Ah.. thank you very much
MockingBird is offline
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 14:58.


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