|
现在论坛搜索功能有问题,即使点了搜索主题还是会去搜索整个帖子,结果列出14页,不想挨个看了...
已知的:
Syntax:
set_task ( Float:time, const function[], id = 0, parameter[]="", len = 0, flags[]="", repeat = 0 )
Type:
Native
Notes:
The parameters break down as such:
* Float:time - Interval of timer in second. (minimum 0.1 seconds)
* function[] - A string that contains the public function to run on the timer.
* id - A unique id to assign to the task.
* parameter - An array contain data to send to the timer function.
* len - Size of the array to send to the timer function.
* flags - One of the following:
-- "a" - Repeat task a specified number of times
-- "b" - Loop task infinitely
-- "c" - do task on time after a map timeleft
-- "d" - do task on time before a map timeleft
* repeat - If flags is "a", specifies the number of times to repeat the task.
Remember that functions executed by set_task needs be public.
Example of executing a task once:
set_task(15.0,"MyFunction")
这些是我目前了解的
// This will call the Function 'MyFunction' 5 Times
// (NOT 6 Times) every 60 Seconds and send the Variable 'id':
public test1(id)
{
set_task(60.0,"MyFunction",id,"",0,"a",5)
}
// This will call the Function 'MyFunction'
// every 30 Seconds and send the Variable 'id':
public test2(id)
{
set_task(30.0,"MyFunction",id,"",0,"b")
}
问题:
set_task ( Float:time, const function[], id = 0, parameter[]="", len = 0, flags[]="", repeat = 0 )
1.一个插件2个任务的id冲突了,比如都是语句 id = 0 会出现什么情况
2.Float:time既然是间隔(interval) 那么当执行到
public plugin_cfg() {
set_task(5.0,....)时是马上执行task标识的fun()一次还是50秒后才执行
}
3.如果 func1() {
new arg[2];
arg[0] = 1;arg[1] = 2;
set_task(time,func2,id = 0,arg,len = 0,...)
} 会出现什么情况? 也就是说我不太清楚这里len和arg的相互影响关系是怎样的?
4.如果设置了 "b",然后repeat = 0 会出现什么情况? "c","d"都是怎样用的呢?
-- "b" - Loop task infinitely
-- "c" - do task on time after a map timeleft
-- "d" - do task on time before a map timeleft
5.如果我只设置 set_task(2.0,func)会是什么样的执行表现呢? 也就是说在不设置flags和repeat的情况下这个task会怎样的去执行func呢?
再有,如果我都用这种默认的,比如:
set_task(2.0,func1)
set_task(2.0,func2)
那么是否会出现taskid冲突导致amxx或者hlds崩溃呢?
6.暂时问这么多,给大家带来的不便请见谅,请各位多指教,最近在看代码`` |
|