Quote:
Originally Posted by fbef0102
Thanks, Lux, one more question, what if I use CreateDataTimer?
should I also write TIMER_DATA_HNDL_CLOSE?
PHP Code:
CreateDataTimer(0.3,CreateRing,hbPack,TIMER_FLAG_NO_MAPCHANGE|TIMER_DATA_HNDL_CLOSE);
|
In short no.
PHP Code:
/**
* Creates a timer associated with a new datapack, and returns the datapack.
* @note The datapack is automatically freed when the timer ends.
* @note The position of the datapack is not reset or changed for the timer function.
*
* @param interval Interval from the current game time to execute the given function.
* @param func Function to execute once the given interval has elapsed.
* @param datapack The newly created datapack is passed though this by-reference
* parameter to the timer callback function.
* @param flags Timer flags.
* @return Handle to the timer object. You do not need to call CloseHandle().
*/
stock Handle CreateDataTimer(float interval, Timer func, Handle &datapack, int flags=0)
{
datapack = new DataPack();
flags |= TIMER_DATA_HNDL_CLOSE;
return CreateTimer(interval, func, datapack, flags);
}
__________________