G
Gridma
Guest
hello,
here's the thing, i put an function in array[0] waits to be excuted and how long it will be delay (seconds) in array[1], then i drop them in to ds_queue using ds_queue_enqueue.
script:
var command;
command[0] = aScript();
command[1] = 1;
ds_queue_enqueue(global.dsqueue,command);
then when i dequeue it from somewhere else, trying to put it into another array, and it executes itself.
script:
if(!ds_queue_empty(global.dsqueue)){
var command;
command = ds_queue_dequeue(global.dsqueue); // executes aScript() and pass array to command
}
i wanted to delay the execution, but it executes immediately after dequeue. how do i fix it? or i simply find another way?
thanks for helping.
here's the thing, i put an function in array[0] waits to be excuted and how long it will be delay (seconds) in array[1], then i drop them in to ds_queue using ds_queue_enqueue.
script:
var command;
command[0] = aScript();
command[1] = 1;
ds_queue_enqueue(global.dsqueue,command);
then when i dequeue it from somewhere else, trying to put it into another array, and it executes itself.
script:
if(!ds_queue_empty(global.dsqueue)){
var command;
command = ds_queue_dequeue(global.dsqueue); // executes aScript() and pass array to command
}
i wanted to delay the execution, but it executes immediately after dequeue. how do i fix it? or i simply find another way?
thanks for helping.