Raised This Month: $ Target: $400
 0% 

[Request] Allow plugin's to create Forward's


  
 
 
Thread Tools Display Modes
Author Message
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-31-2006 , 03:20   [Request] Allow plugin's to create Forward's
#1

A native to allow plugin's tbe able to create forward's like module's.

MF_ExecuteForward & MF_RegisterForward
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 01-31-2006 , 16:42  
#2

You can already do this using callfuncs.

Here is an example of a global callback, that can be blocked:

Code:
stock send_callback_simple(func[]) {     new used = 0;     for(new i = 0; i < get_pluginsnum(); i++)     {         new filename[100],other[100]         get_plugin ( i,filename,99,other,99,other,99,other,99,other,99 )         new check = callfunc_begin ( func, filename )         if(check > 0)         {             used = 1;             if( callfunc_end ( ) == PLUGIN_HANDLED) return 1;         }     }     return used; }

Configure it to your pleasure.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-31-2006 , 16:52  
#3

Thanks Twlight. You can lock this.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
BAILOPAN
Join Date: Jan 2004
Old 01-31-2006 , 17:58  
#4

unlocking. I think it's a good idea to provide plugins (essentially) the same api that modules get for automatising forwards.

this API already exists and wouldn't be hard to abstract back to plugins.
__________________
egg
BAILOPAN is offline
BAILOPAN
Join Date: Jan 2004
Old 02-01-2006 , 06:10  
#5

update: this was pretty easy to implement, here's a demo of it for 1.65:

Code:
#include <amxmodx> new g_fwd_what public plugin_init() {     register_plugin("forward test", "1.0", "BAILOPAN")     register_srvcmd("fwd_test", "Command_FwdTest")         g_fwd_what = CreateMultiForward("Event_What", ET_STOP, FP_STRING, FP_CELL, FP_ARRAY) } public Event_What(str[], d, arr[]) {     server_print("Event what called with (%s) num = %d|%d (should be 5|37)", str, d, arr[d])         return PLUGIN_CONTINUE } public Command_FwdTest() {     new array[6], ret     array[5] = 37         new pArray = PrepareArray(array, 6)     if (!ExecuteForward(g_fwd_what, ret, "gaben", 5, pArray))     {         server_print("FAILED!")     } }
__________________
egg
BAILOPAN is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 02-01-2006 , 07:07  
#6

nice.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
 



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 15:20.


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