Raised This Month: $ Target: $400
 0% 

Combine 2 orpheu plugin functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 02-19-2013 , 23:28   Combine 2 orpheu plugin functions
Reply With Quote #1

Hi. I've tried to combine 2 plugins using same orpheu function, and i can't get it to work. obviously same function is registered twice as same as the hook. What can i do ?

Code:
new OrpheuHook:handlePrintf 

public TaskShowFPS()
{
.....
new OrpheuHook:hHandlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" );
}

public OrpheuHookReturn:Con_Printf( const a[ ], const szMessage[ ] )
{
    copy( g_szStatsResult, charsmax( g_szStatsResult ), szMessage );
    
    return OrpheuSupercede;
}

public OrpheuHookReturn:OrpheuHookPre(const a[], const b[] , const c[] ) 
{ 
    
   handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" , OrpheuHookPre); 
   return OrpheuIgnored; 
} 

public OrpheuHookReturn:Con_Printf(const a[], const b[]) 
{ 
   if (containi(b,"testing")>-1) 
   { 
      new msg[256] 
      copy(msg,255,b) 
      del_log(msg) 
      return OrpheuSupercede; 
   } 
       
   return OrpheuIgnored; 
}
EDUTz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-20-2013 , 00:03   Re: Combine 2 orpheu plugin functions
Reply With Quote #2

Don't combine them. This is the best answer 95% of the time. You will need to give a good reason for anyone to give a different answer.
__________________
fysiks 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 21:40.


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