added
amb595, eye position and angle natives
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is part of the SourceMod/SourcePawn SDK. This file may only be used
8 * or modified under the Terms and Conditions of its License Agreement, which is found
9 * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
10 * may change at any time. To view the latest information, see:
11 * http://www.sourcemod.net/license.php
16 #if defined _timers_included
19 #define _timers_included
23 #define TIMER_REPEAT (1<<0) /**< Timer will repeat until it returns Plugin_Stop */
24 #define TIMER_FLAG_NO_MAPCHANGE (1<<1) /**< Timer will not carry over mapchanges */
25 #define TIMER_HNDL_CLOSE (1<<9) /**< Timer will automatically call CloseHandle() on its value when finished */
28 * Any of the following prototypes will work for a timed function.
33 * Called when the timer interval has elapsed.
35 * @param timer Handle to the timer object.
36 * @param hndl Handle passed when the timer was created.
37 * @return Plugin_Stop to stop a repeating timer, any other value for
40 Action:public(Handle:timer, Handle:hndl),
43 * Called when the timer interval has elapsed.
45 * @param timer Handle to the timer object.
46 * @param value Value passed when the timer was created.
47 * @return Plugin_Stop to stop a repeating timer, any other value for
50 Action:public(Handle:timer, any:value),
53 * Called when the timer interval has elapsed.
55 * @param timer Handle to the timer object.
56 * @return Plugin_Stop to stop a repeating timer, any other value for
59 Action:public(Handle:timer),
63 * Creates a basic timer. Calling CloseHandle() on a timer will end the timer.
65 * @param interval Interval from the current game time to execute the given function.
66 * @param func Function to execute once the given interval has elapsed.
67 * @param value Handle or value to give to the timer function.
68 * @param flags Flags to set (such as repeatability or auto-Handle closing).
69 * @return Handle to the timer object. You do not need to call CloseHandle().
71 native Handle:CreateTimer(Float:interval, Timer:func, any:value=INVALID_HANDLE, flags=0);
74 * Kills a timer. Use this instead of CloseHandle() if you need more options.
76 * @param autoClose If autoClose is true, the timer's value will be
77 * closed as a handle if TIMER_HNDL_CLOSE was not specified.
80 native KillTimer(Handle:timer, bool:autoClose=false);
83 * Manually triggers a timer so its function will be called.
85 * @param timer Timer Handle to trigger.
86 * @param reset If reset is true, the elapsed time counter is reset
87 * so the full interval must pass again.
90 native TriggerTimer(Handle:timer, bool:reset=false);
93 * Returns the simulated game time.
95 * @param simulated Retrieves whether or not the tick count
96 * is being manually simulated by SourceMod.
97 * This is the case if no players have joined
99 * @return Time based on the game tick count.
101 native Float:GetTickedTime(&bool:simulated);
104 * Creates a timer associated with a new data pack, and returns the datapack.
105 * @note The datapack is automatically freed when the timer ends.
106 * @note The position of the datapack is not reset or changed for the timer function.
108 * @param interval Interval from the current game time to execute the given function.
109 * @param func Function to execute once the given interval has elapsed.
110 * @param data The newly created datapack is passed though this by-reference parameter.
111 * @param flags Timer flags.
112 * @return Handle to the timer object. You do not need to call CloseHandle().
114 stock Handle:CreateDataTimer(Float:interval, Timer:func, &Handle:data, flags=0)
116 data = CreateDataPack();
117 flags |= TIMER_HNDL_CLOSE;
118 return CreateTimer(interval, func, data, flags);