set_task help ! (passing arguments to a function)
Hello ...
I need help with passing arguments to a function when there are more than 1 arguments ... for example, when I want to call function something(id) i do: set_task(0.1, "something", id) and that works perfectly ... but how do I call function something(id, number) ? set_task(0.1, "something", id, number) <- doesn't work it passes only first argument ... any help ? :) |
Re: set_task help ! (passing arguments to a function)
Like this I believe (off the top of my head):
PHP Code:
|
Re: set_task help ! (passing arguments to a function)
Call the function directly instead of setting a task:
Code:
|
Re: set_task help ! (passing arguments to a function)
Quote:
|
Re: set_task help ! (passing arguments to a function)
i need to do it delayed, so thats why I can't call it directly ...
thanks fysiks, I'll try that and say how it works ... btw, I need to pass a string, so hopefully that will work ... function(id, message) |
Re: set_task help ! (passing arguments to a function)
Code:
new message[192]Error: Must be assigned to an array on line 72 and I can't put it as global variable because I maybe wont be using 0.1 delay (maybe more) so it can be possible that global variable gets changed by someone else before the function is called ... |
Re: set_task help ! (passing arguments to a function)
A 0.1 second delay is almost like executing it directly. Just more inefficient.
|
Re: set_task help ! (passing arguments to a function)
Quote:
I will most likely use something around 5 seconds ... |
Re: set_task help ! (passing arguments to a function)
How many parameters do you need to pass?
|
Re: set_task help ! (passing arguments to a function)
2
id and message ... int + string ... |
| All times are GMT -4. The time now is 17:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.