AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about MultiForward (https://forums.alliedmods.net/showthread.php?t=116487)

xbatista 01-23-2010 12:24

Question about MultiForward
 
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?

joropito 01-23-2010 21:33

Re: Question about MultiForward
 
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

Exolent[jNr] 01-23-2010 23:35

Re: Question about MultiForward
 
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.

xbatista 01-24-2010 06:13

Re: Question about MultiForward
 
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?


All times are GMT -4. The time now is 07:26.

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