Half-Life и Adrenaline Gamer форум
http://aghl.ru/forum/

Attach View Not Working On Set Task
http://aghl.ru/forum/viewtopic.php?f=20&t=2557
Страница 1 из 1

Автор:  yemet123 [ 21 сен 2016, 23:17 ]
Заголовок сообщения:  Attach View Not Working On Set Task

Hi, I want simon suicider die cutscene but have some problem.
can help me?.

 

Автор:  Lev [ 22 сен 2016, 02:47 ]
Заголовок сообщения:  Re: Attach View Not Working On Set Task

You do not pass parameters correctly.
To pass only one parameter you can use task ID. I.e. your function will receive task ID as first parameter:
Код:
new task_ID = 123;
set_task(time, "function", task_ID);

public function(task_ID)
{
// task_ID == 123
Task ID is unique inside a plugin, so if you call set_task with the same task ID, that scheduled task will be replaced (with new function, parameters, whatever). So you need to specify different task ID. The easiest way to do that is to use some constant value and add the single parameter value to it:
Код:
const MY_TASK_BASE = 1000;
for (new id = 1; id < 33; id++)
  set_task(time, "function", MY_TASK_BASE + id);

public function(task_ID)
{
// task_ID will be from 1001 to 1032
  new id = task_ID - MY_TASK_BASE;
In that code function will be called 32 times with different task_ID ranging from 1001 up to 1032, so single parameter (id) can be calculated from it by subtracting task ID base constant.
To pass more than 1 parameter you will have to use parameter array:
Код:
native set_task(Float:time,const function[],id = 0,const parameter[]="",len = 0,const flags[]="", repeat = 0);
Код:
   new data[2];
   data[0] = id;
   data[1] = ent;
   set_task(1.0, "function", task_ID, data, sizeof(data));

public function(task_ID, data, dataSize)
{
  new id = data[0];
  new ent = data[1];

Автор:  yemet123 [ 22 сен 2016, 10:28 ]
Заголовок сообщения:  Re: Attach View Not Working On Set Task

Here....

Вложения:
Скачать плагин или Скачать исходник [npc_cof_suicide.sma - 24.54 КБ]
Скачиваний: 340

Автор:  yemet123 [ 22 сен 2016, 19:27 ]
Заголовок сообщения:  Re: Attach View Not Working On Set Task

I can't understanded

Страница 1 из 1 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/