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

[TF2] Detecting when Merasmus makes the server dance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lostprophetpunk
Member
Join Date: Oct 2012
Old 09-09-2014 , 12:58   [TF2] Detecting when Merasmus makes the server dance
Reply With Quote #1

Heya there,

Is there any way I can detect whether Merasmus makes the server dance or not?
lostprophetpunk is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-09-2014 , 14:03   Re: [TF2] Detecting when Merasmus makes the server dance
Reply With Quote #2

The wheel_of_doom entity (which is what causes the various effects) has an OnEffectApplied output. Unfortunately, it's not documented as to what values are passed to it, but since they affect all players, it can be assumed it's just the condition number.

tf2.inc contains a list of all the conditions, including TFCond_HalloweenThriller which is the one you're looking for.

Edit: I'll have a code sample soon, I just have yet to write it.

Edit 2: Meh, not really working as you can't tell what effect it is... however, you can hook when conditions apply to players...

PHP Code:
#include <tf2>

new bool:g_bDancing false;

public 
OnMapStart()
{
    
g_bDancing false;
}

public 
TF2_OnConditionAdded(clientTFCond:condition)
{
    if (!
g_bDancing && condition == TFCond_HalloweenThriller)
    {
        
g_bDancing true;
        
// Put code here to run when dancing starts.
    
}
}

public 
TF2_OnConditionRemoved(clientTFCond:condition)
{
    if (
g_bDancing && condition == TFCond_HalloweenThriller)
    {
        
g_bDancing false;
        
// Put code here to run when dancing stops.
    
}

__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-09-2014 at 14:15.
Powerlord 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 12:06.


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