Added check to make sure player are alive to perform sm_slap, sm_burn, sm_slay.
3 * ================================================================
5 * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
6 * ================================================================
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License,
10 * version 3.0, as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to
21 * link the code of this program (as well as its derivative works) to
22 * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
23 * Game MODs that run on software by the Valve Corporation. You must
24 * obey the GNU General Public License in all respects for all other
25 * code used. Additionally, AlliedModders LLC grants this exception
26 * to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version
28 * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
33 #ifndef _INCLUDE_SOURCEMOD_TIMER_SYSTEM_H_
34 #define _INCLUDE_SOURCEMOD_TIMER_SYSTEM_H_
37 * @file ITimerSystem.h
38 * @brief Contains functions for creating and managing timers.
42 #include <IShareSys.h>
43 #include <IForwardSys.h>
45 #define SMINTERFACE_TIMERSYS_NAME "ITimerSys"
46 #define SMINTERFACE_TIMERSYS_VERSION 1
53 * @brief Event callbacks for when a timer is executed.
59 * @brief Called when a timer is executed.
61 * @param pTimer Pointer to the timer instance.
62 * @param pData Private pointer passed from host.
63 * @return Pl_Stop to stop timer, Pl_Continue to continue.
65 virtual ResultType OnTimer(ITimer *pTimer, void *pData) =0;
68 * @brief Called when the timer has been killed.
70 * @param pTimer Pointer to the timer instance.
71 * @param pData Private data pointer passed from host.
73 virtual void OnTimerEnd(ITimer *pTimer, void *pData) =0;
76 #define TIMER_FLAG_REPEAT (1<<0) /**< Timer will repeat until stopped */
77 #define TIMER_FLAG_NO_MAPCHANGE (1<<1) /**< Timer will not carry over mapchanges */
79 class ITimerSystem : public SMInterface
82 const char *GetInterfaceName()
84 return SMINTERFACE_TIMERSYS_NAME;
86 unsigned int GetInterfaceVersion()
88 return SMINTERFACE_TIMERSYS_VERSION;
92 * @brief Creates a timed event.
94 * @param pCallbacks Pointer to ITimedEvent callbacks.
95 * @param fInterval Interval, in seconds, of the timed event to occur.
96 * The smallest allowed interval is 0.1 seconds.
97 * @param pData Private data to pass on to the timer.
98 * @param flags Extra flags to pass on to the timer.
99 * @return An ITimer pointer on success, NULL on failure.
101 virtual ITimer *CreateTimer(ITimedEvent *pCallbacks,
107 * @brief Kills a timer.
109 * @param pTimer Pointer to the ITimer structure.
112 virtual void KillTimer(ITimer *pTimer) =0;
115 * @brief Arbitrarily fires a timer. If the timer is not a repeating
116 * timer, this will also kill the timer.
118 * @param pTimer Pointer to the ITimer structure.
119 * @param delayExec If true, and the timer is repeating, the
120 * next execution will be delayed by its interval.
123 virtual void FireTimerOnce(ITimer *pTimer, bool delayExec=false) =0;
127 #endif //_INCLUDE_SOURCEMOD_TIMER_SYSTEM_H_