About set_task
After reading set_task's funcwiki page (and finding it pretty weird, by the way) I've got into a small question. I want to make a task that will pass a player's ID and a string as parameters.
1 - Do I have to "hide" the ID within the string's array? 2 - Is the parameter[] array internally copied in AMXX or is it kept inside Pawn for efficiency (similar to Lua)? Thanks in advance. |
Re: About set_task
- You can, but you can pass the id as taskid too, it's fine.
- Not sure to understand, you can check yourself by looking at amxmodx.cpp and CTask.cpp. |
Re: About set_task
You do not have to hide the id in the string array. You can pass the player id as task-id and then the string by itself.
PHP Code:
|
Re: About set_task
Thank you, both of you. I'll have a look at the implementation (I was trying to avoid passing the player's ID as Task ID but...
|
Re: About set_task
Quote:
If you don't want to pass player-id as task-id (for whatever reason) you will have to 'hide' the player id in the passed array. PHP Code:
|
Re: About set_task
Why do you want to avoid ?
|
Re: About set_task
I don't know, it looks like a bad practice to use internal information to hide public one.
|
Re: About set_task
Not really, after all you need to pass a random number, it makes sense to pass a number related to the player's index.
|
Re: About set_task
Well, ok, I surrender, please don't shoot!
|
Re: About set_task
:twisted:
Use an array if you feel like to use this way, but it will be really a pain to creat e each time when you can pass directly the index. :p |
| All times are GMT -4. The time now is 22:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.