Raised This Month: $ Target: $400
 0% 

Question about Execute_Forward


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
csoldjb
Member
Join Date: Dec 2010
Old 05-11-2011 , 09:34   Question about Execute_Forward
Reply With Quote #1

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
csoldjb is offline
Old 05-11-2011, 10:13
Hunter-Digital
This message has been deleted by Hunter-Digital. Reason: actually, I wanna test something...
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-11-2011 , 10:37   Re: Question about Execute_Forward
Reply With Quote #2

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...
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-11-2011 , 10:51   Re: Question about Execute_Forward
Reply With Quote #3

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)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-11-2011 at 10:54.
ConnorMcLeod is offline
csoldjb
Member
Join Date: Dec 2010
Old 05-11-2011 , 11:23   Re: Question about Execute_Forward
Reply With Quote #4

Thanks to Hunter-Digital and ConnorMcLeod.

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

Thanks!
csoldjb 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 04:17.


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