Raised This Month: $ Target: $400
 0% 

Fake Forwards


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-29-2009 , 02:12   Fake Forwards
Reply With Quote #1

Is it a problem to have something like this:
Code:
forward my_forward(); new g_forward, g_return; public plugin_natives() {     register_library("my_library");         g_forward = CreateMultiForward("my_forward", ET_IGNORE); } //... ExecuteForward(g_forward, g_return);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-29-2009 , 04:02   Re: Fake Forwards
Reply With Quote #2

Are you asking wether the forward that a plugin creates can exist in that plugin?
If so, I think yes..
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-29-2009 , 06:28   Re: Fake Forwards
Reply With Quote #3

It's not a problem, it will be a forward with no params.
You may be interested in create single forwards for each plugins that needs it, like it's done in atac plugin, don't know what is the best though, just think like orangutanz wouldn't have bother to do it if it wasn't making any benefit.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 03-29-2009 , 09:01   Re: Fake Forwards
Reply With Quote #4

No, Any problem. my_forward()
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-29-2009 , 14:58   Re: Fake Forwards
Reply With Quote #5

Quote:
Originally Posted by ot_207 View Post
Are you asking wether the forward that a plugin creates can exist in that plugin?
If so, I think yes..
This is what I was talking about.
Can anyone else back this up? I'd like a definite answer.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-29-2009 , 15:01   Re: Fake Forwards
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
This is what I was talking about.
Can anyone else back this up? I'd like a definite answer.
I trully don't see why it should not work. Beeing a multi forward the core will automatically call the function in every plugin, and that includes the one that created it.

Edit:
If you want you can test that in my speed api.
http://forums.alliedmods.net/showthread.php?t=77940
put the forward in it and see what happens...
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Old 03-29-2009, 15:02
ot_207
This message has been deleted by ot_207. Reason: double post
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-29-2009 , 18:04   Re: Fake Forwards
Reply With Quote #7

Code:
 new SkillForward[TOTAL_SKILLS+1] = {-1, ...}

//...

 ValidSkillForward( const skill )
 {
	if( !ValidSkill(skill) ){
		return -1;
	}
	if( SkillForward[skill] == -1 ){
		if( SkillInfo[skill] & SI_PUBLIC )
			SkillForward[skill] = CreateMultiForward( SkillName[skill], ET_STOP, FP_CELL, FP_CELL, FP_CELL);
		else
			SkillForward[skill] = CreateOneForward( plugin_id, SkillName[skill], FP_CELL, FP_CELL, FP_CELL );
	}
	return SkillForward[skill];
 }

//...

 ExecuteForward( ValidSkillForward(skill), temp_return, id, skill, prop );
Works fine for me
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Reply


Thread Tools
Display Modes

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 08:59.


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