2008-10-04 22:59:11 +02:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
|
|
|
* =============================================================================
|
2019-09-27 13:14:44 +02:00
|
|
|
* SourceMod (C)2004-2017 AlliedModders LLC. All rights reserved.
|
2008-10-04 22:59:11 +02:00
|
|
|
* =============================================================================
|
|
|
|
*
|
|
|
|
* This file is part of the SourceMod/SourcePawn SDK.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
|
|
* Free Software Foundation.
|
2019-09-27 13:14:44 +02:00
|
|
|
*
|
2008-10-04 22:59:11 +02:00
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
|
|
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
|
|
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
|
|
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
|
|
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
|
|
* this exception to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
|
|
* or <http://www.sourcemod.net/license.php>.
|
|
|
|
*
|
2009-04-14 23:40:48 +02:00
|
|
|
* Version: $Id$
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#if defined _sdktools_entoutput_included
|
2019-09-27 13:14:44 +02:00
|
|
|
#endinput
|
2008-10-04 22:59:11 +02:00
|
|
|
#endif
|
|
|
|
#define _sdktools_entoutput_included
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when an entity output is fired.
|
|
|
|
*
|
2019-09-27 13:14:44 +02:00
|
|
|
* @param output Name of the output that fired.
|
|
|
|
* @param caller Entity index of the caller.
|
|
|
|
* @param activator Entity index of the activator.
|
|
|
|
* @param delay Delay in seconds? before the event gets fired.
|
|
|
|
* @return Anything other than Plugin_Continue will supress this event,
|
|
|
|
* returning Plugin_Continue will allow it to propagate the results
|
|
|
|
* of this output to any entity inputs.
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
typeset EntityOutput
|
|
|
|
{
|
|
|
|
function void (const char[] output, int caller, int activator, float delay);
|
|
|
|
function Action (const char[] output, int caller, int activator, float delay);
|
|
|
|
};
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an entity output hook on a entity classname
|
|
|
|
*
|
2019-09-27 13:14:44 +02:00
|
|
|
* @param classname The classname to hook.
|
|
|
|
* @param output The output name to hook.
|
|
|
|
* @param callback An EntityOutput function pointer.
|
|
|
|
* @error Entity Outputs disabled.
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native void HookEntityOutput(const char[] classname, const char[] output, EntityOutput callback);
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove an entity output hook.
|
2019-09-27 13:14:44 +02:00
|
|
|
* @param classname The classname to hook.
|
|
|
|
* @param output The output name to hook.
|
|
|
|
* @param callback An EntityOutput function pointer.
|
|
|
|
* @return True on success, false if no valid hook was found.
|
|
|
|
* @error Entity Outputs disabled.
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native bool UnhookEntityOutput(const char[] classname, const char[] output, EntityOutput callback);
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
2019-09-27 13:14:44 +02:00
|
|
|
* Add an entity output hook on a single entity instance
|
2008-10-04 22:59:11 +02:00
|
|
|
*
|
2019-09-27 13:14:44 +02:00
|
|
|
* @param entity The entity on which to add a hook.
|
|
|
|
* @param output The output name to hook.
|
|
|
|
* @param callback An EntityOutput function pointer.
|
|
|
|
* @param once Only fire this hook once and then remove itself.
|
|
|
|
* @error Entity Outputs disabled or Invalid Entity index.
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native void HookSingleEntityOutput(int entity, const char[] output, EntityOutput callback, bool once=false);
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
2019-09-27 13:14:44 +02:00
|
|
|
* Remove a single entity output hook.
|
2008-10-04 22:59:11 +02:00
|
|
|
*
|
2019-09-27 13:14:44 +02:00
|
|
|
* @param entity The entity on which to remove the hook.
|
|
|
|
* @param output The output name to hook.
|
|
|
|
* @param callback An EntityOutput function pointer.
|
|
|
|
* @return True on success, false if no valid hook was found.
|
|
|
|
* @error Entity Outputs disabled or Invalid Entity index.
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native bool UnhookSingleEntityOutput(int entity, const char[] output, EntityOutput callback);
|
2019-09-27 13:14:44 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fire a named output on an entity.
|
|
|
|
*
|
|
|
|
* After completion (successful or not), the current global variant is re-initialized.
|
|
|
|
*
|
|
|
|
* @param caller Entity index from where the output is fired.
|
|
|
|
* @param output Output name.
|
|
|
|
* @param activator Entity index which initiated the sequence of actions (-1 for a NULL entity).
|
|
|
|
* @param delay Delay before firing the output.
|
|
|
|
* @error Invalid entity index or no mod support.
|
|
|
|
*/
|
|
|
|
native void FireEntityOutput(int caller, const char[] output, int activator=-1, float delay=0.0);
|