Raised This Month: $51 Target: $400
 12% 

Can I pass ParamArray by reference?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-25-2019 , 10:44   Can I pass ParamArray by reference?
Reply With Quote #1

Something like:

Code:
void foo(const char[] format, &any ...)
to return data to ParamArray members?

Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-25-2019 , 12:23   Re: Can I pass ParamArray by reference?
Reply With Quote #2

Afaik sm already warns you when you pass arrays by reference, because they do already by default.
Mitchell is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-25-2019 , 12:33   Re: Can I pass ParamArray by reference?
Reply With Quote #3

So, I can use VFormat to retrieve data from that array.
How can I save data to that array?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 03-26-2019 at 00:29.
Dragokas is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-25-2019 , 23:16   Re: Can I pass ParamArray by reference?
Reply With Quote #4

It's been a while since I've dealt with extensions, but don't you just use pContext->LocalToPhysAddr ?

Edit: Like

PHP Code:
cell_t *arrayFromPlugin;
pContext->LocalToPhysAddr(params[1], &arrayFromPlugin); 
Edit 2: The original reply chain mentioned C++, in case this seems like it's out of left field now.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-26-2019 at 00:33.
Powerlord is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-26-2019 , 00:30   Re: Can I pass ParamArray by reference?
Reply With Quote #5

Powerlord, sorry, it was misunderstanding. I didn't mean extension. I edited my answer.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode