Raised This Month: $ Target: $400
 0% 

Question about MultiForward


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 01-23-2010 , 12:24   Question about MultiForward
Reply With Quote #1

1-st plugin (main) :
PHP Code:
new g_TakeDamage;
// plugin_init
g_TakeDamage CreateMultiForward("d2_takedamage"ET_IGNOREFP_CELLFP_CELLFP_FLOAT);

// Other public function
public kaka(victimattacker)
{
      new 
Float:value;
      
ExecuteForwardg_TakeDamageg_iReturnvictimattackervalue);

      
// print here 'value' for example

.INC :
PHP Code:
forward d2_takedamage(victimattackerFloat:value); 
2-nd plugin :
PHP Code:
public d2_takedamage(victimattackerFloat:value)
{
    
value += value

I want that when you call forward in other plugin 'd2_takedamage' and change 'value' in that forward I want it to be changed in 1-st plugin, how to do it?
__________________
xbatista is offline
Send a message via Skype™ to xbatista
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 01-23-2010 , 21:33   Re: Question about MultiForward
Reply With Quote #2

I don't know if it can be done but I understand there's another way.

Pass the parameter as array of Float and with PrepareArray set copyback to 1. I think it should work.

https://forums.alliedmods.net/showthread.php?t=41241
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-23-2010 , 23:35   Re: Question about MultiForward
Reply With Quote #3

You could also use the callfunc_* natives instead of a forward.
It will simulate the forward if you use it correctly and you can get the same information if not more.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 01-24-2010 , 06:13   Re: Question about MultiForward
Reply With Quote #4

Oh I get it joropito, so PrepareArray can change main plugin values?

Exolent I don't really want to use callfunc_* , forward in this case is better to me it's easier.
Btw I need to destroy the forward on plugin_end? Is it needed so?
__________________
xbatista is offline
Send a message via Skype™ to xbatista
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 07:26.


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