AlliedModders

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

csoldjb 05-11-2011 09:34

Question about Execute_Forward
 
Sorry for my bad English:)

In my main plugin
(plugin_init)
g_fwString = CreateMultiForward("test_get_string",ET_IGNOR E,FP_CELL,FP_STRING)

and I use it like this:
new ret
new sz[128]
ExecuteForward(g_fwString,ret,id,sz)
client_print(1,print_chat,"[Test] [ExeForward] [GetString:%s]",sz)

And in my sub plugin:
public test_get_string(id,sz[])
{
copy(sz,charsmax(sz),"TestText")
}

Here is the question: I can't get the proper text "TestText",
The plugin print this" [Test] [ExeForward] [GetString:]"

so how to correct this error?
Thank you:)

Hunter-Digital 05-11-2011 10:37

Re: Question about Execute_Forward
 
Well, I did some testing, I can't return strings for forwards, only numbers... maybe someone else knows how but I don't.

What exacly do you need ? Because you can send strings to the main plugin using natives... you could mix them up, when forward is sent, set a native and the main plugin receives that string...

ConnorMcLeod 05-11-2011 10:51

Re: Question about Execute_Forward
 
May be you should use PrepareArray ?
http://www.amxmodx.org/funcwiki.php?go=func&id=1047


EDIT :
Ops, misread, you can't change a param in the forward callback, may be you could use fake natives instead, or mix both system like create some natives that are usable only when you are in a specific forward, as get_user_cmd et set_user_cmd engine natives that are only usable in CmdStart forward (called Client_Impulse in engine module)

csoldjb 05-11-2011 11:23

Re: Question about Execute_Forward
 
Thanks to Hunter-Digital and ConnorMcLeod.

I use a native function and a global var after the forward called.
This tested very Good!

Thanks!:)


All times are GMT -4. The time now is 04:17.

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