Raised This Month: $ Target: $400
 0% 

HookEntityOutput not work if entity has a some filter.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Frenzzy
SourceMod Donor
Join Date: Jan 2007
Location: Russia
Old 10-02-2011 , 18:18   HookEntityOutput not work if entity has a some filter.
Reply With Quote #1

Hello!

HookEntityOutput and HookSingleEntityOutput is not fired output if hooked entity has a some filter.

For example:
PHP Code:
// Entity: trigger_teleport
// Option: target "destination"
// Option: filtername "filter_activator" // Trigger use filter
// Option: origin "0 0 0"
// Option: angles "0 0 0"
// Option: spawnflags "1"
// Option: StartDisabled "0"

// Entity: filter_activator_name
// Option: targetname "filter_activator"
// Option: Negated "0"
// Option: filtername "activator"

public OnPluginStart()
{
    
HookEntityOutput("trigger_teleport""OnEndTouch"Teleport_OnEndTouch);
}

public 
Teleport_OnEndTouch(const String:output[], calleractivatorFloat:delay)
{
    
// This line never fired because trigger_teleport has filter_activator.
    
PrintToServer("Trigger teleport %d end touch entity %d"calleractivator);

If there is no filter, everything works fine.

How can I solve this problem?

Added:
I would like to get an event when a player is teleported by trigger_teleport. But OnTrigger output is not working for me =/

Last edited by Frenzzy; 10-02-2011 at 20:53.
Frenzzy is offline
Send a message via ICQ to Frenzzy Send a message via MSN to Frenzzy Send a message via Skype™ to Frenzzy
ejik03
AlliedModders Donor
Join Date: Feb 2009
Location: Moscow, Russia
Old 10-03-2011 , 05:49   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #2

Instead of OnEndTouch use OnStartTouch.
ejik03 is offline
Frenzzy
SourceMod Donor
Join Date: Jan 2007
Location: Russia
Old 10-03-2011 , 13:40   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #3

Quote:
Originally Posted by ejik03 View Post
Instead of OnEndTouch use OnStartTouch.
This changes nothing, the same result.
Frenzzy is offline
Send a message via ICQ to Frenzzy Send a message via MSN to Frenzzy Send a message via Skype™ to Frenzzy
ejik03
AlliedModders Donor
Join Date: Feb 2009
Location: Moscow, Russia
Old 10-03-2011 , 14:24   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #4

hm... OnStartTouch works fine for me.

Set filtername to "", and try again...
ejik03 is offline
Frenzzy
SourceMod Donor
Join Date: Jan 2007
Location: Russia
Old 10-03-2011 , 15:55   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #5

Yes, without a filter is works fine, but I needed a filter.
Frenzzy is offline
Send a message via ICQ to Frenzzy Send a message via MSN to Frenzzy Send a message via Skype™ to Frenzzy
maza51
Senior Member
Join Date: Mar 2010
Old 10-03-2011 , 16:11   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #6

Quote:
Originally Posted by Frenzzy View Post
Yes, without a filter is works fine, but I needed a filter.
PHP Code:
public Teleport_OnEndTouch(const String:output[], calleractivatorFloat:delay)
{
    for (new 
client 1client MaxClientsclient++)
    {
        if (
client == activator)
        {
            
//
        
}
    }

maza51 is offline
Frenzzy
SourceMod Donor
Join Date: Jan 2007
Location: Russia
Old 10-03-2011 , 16:23   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #7

Quote:
Originally Posted by maza51 View Post
PHP Code:
public Teleport_OnEndTouch(const String:output[], calleractivatorFloat:delay)
{
    for (new 
client 1client MaxClientsclient++)
    {
        if (
client == activator)
        {
            
//
        
}
    }

You think with your code the trigger_teleport will teleport only one player and not all?)

Honestly, I do not understand for what this cycle. If you want to check "The activator is a client?", it looks like this:

PHP Code:
public Teleport_OnEndTouch(const String:output[], calleractivatorFloat:delay)
{
    if (
activator && activator <= MaxClients)
    {
        
//
    
}

Frenzzy is offline
Send a message via ICQ to Frenzzy Send a message via MSN to Frenzzy Send a message via Skype™ to Frenzzy
maza51
Senior Member
Join Date: Mar 2010
Old 10-03-2011 , 17:33   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #8

Quote:
Originally Posted by Frenzzy View Post
You think with your code the trigger_teleport will teleport only one player and not all?)

Honestly, I do not understand for what this cycle. If you want to check "The activator is a client?", it looks like this:

PHP Code:
public Teleport_OnEndTouch(const String:output[], calleractivatorFloat:delay)
{
    if (
activator && activator <= MaxClients)
    {
        
//
    
}

I've just given you an example leash, how to compare a player with a filter.
Я тебе показал пример просто как можно фильтровать.
Я не вижу твоего остального кода и не могу знать что ты хочешь.

Last edited by maza51; 10-03-2011 at 17:37.
maza51 is offline
Frenzzy
SourceMod Donor
Join Date: Jan 2007
Location: Russia
Old 10-03-2011 , 20:25   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #9

I just want to get an event when player is teleported through trigger_teleport.

This is never fired, why?
HookEntityOutput("trigger_teleport", "OnTrigger", MyFunction);

This is never fired if trigger_teleport has a some filter, why?
HookEntityOutput("trigger_teleport", "OnStartTouch", MyFunction);
HookEntityOutput("trigger_teleport", "OnEndTouch", MyFunction);

I want to know what it - sourcemod bug or I'm doing something wrong..
Frenzzy is offline
Send a message via ICQ to Frenzzy Send a message via MSN to Frenzzy Send a message via Skype™ to Frenzzy
maza51
Senior Member
Join Date: Mar 2010
Old 10-03-2011 , 22:04   Re: HookEntityOutput not work if entity has a some filter.
Reply With Quote #10

What do you want to do?
Maybe there's a simpler solution
maza51 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 22:05.


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