Raised This Month: $ Target: $400
 0% 

Hooking Entities Issue


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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